C# regular expressions, HTML & removal of text between <script> tags

Discussion in 'Perl Misc' started by john.w.blair@gmail.com, Apr 11, 2005.

  1. Guest

    Can someone help me out this this please? How does one remove content
    between script tags and the script tags themselves using C# regular
    expressions?


    Thanks!
     
    , Apr 11, 2005
    #1
    1. Advertising

  2. John Bokma Guest

    John Bokma, Apr 11, 2005
    #2
    1. Advertising

  3. wrote:

    > Can someone help me out this this please? How does one remove content
    > between script tags and the script tags themselves using C# regular
    > expressions?
    >

    One: You do *not* attempt to parse HTML with regexps. Parsing
    HTML is a nontrivial task and regular expressions are not adequate.

    Two: This is a Perl newgroups. Why would we be able to help you
    with C#?

    Three: Er, what's the difference between "script tags" and "the script
    tags themselves"?

    --
    Christopher Mattern

    "Which one you figure tracked us?"
    "The ugly one, sir."
    "...Could you be more specific?"
     
    Chris Mattern, Apr 11, 2005
    #3
  4. <> wrote:

    > using C# regular
    > expressions?



    You have found the wrong newsgroup.

    We do Perl in the Perl newsgroup.


    (and regular expressions do not change text anyway, they "match"
    or "don't match" strings. Perl has an operator that changes
    text and makes use of regular expressions though. What operators
    are available to you in C# is a mystery to me. Find a C# newsgroup.
    )

    (also, using regular expressions on a context-free language such
    as HTML is impossible in the general case. You need a Real Parser.
    Have you seen the Perl FAQ about removing HTML from a string?
    )


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
     
    Tad McClellan, Apr 11, 2005
    #4
  5. wrote:
    > Can someone help me out this this please? How does one remove content
    > between script tags and the script tags themselves


    Please let us know which problems you have with the answer in the FAQ such
    that we can improve it.

    > using C#


    Are you sure you are in the right NG?

    > regular expressions?


    As has been pointed out many, many times (did you check google, this NG, or
    the FAQ) no sane person would try to parse HTML using regular expressions.

    jue
     
    Jürgen Exner, Apr 12, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jay Douglas
    Replies:
    0
    Views:
    643
    Jay Douglas
    Aug 15, 2003
  2. Replies:
    3
    Views:
    548
    Wibble
    May 28, 2005
  3. Thierry Lam
    Replies:
    7
    Views:
    420
    Neredbojias
    May 2, 2009
  4. Replies:
    20
    Views:
    758
  5. Noman Shapiro
    Replies:
    0
    Views:
    261
    Noman Shapiro
    Jul 17, 2013
Loading...

Share This Page