Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > C# regular expressions, HTML & removal of text between <script> tags

Reply
Thread Tools

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

 
 
john.w.blair@gmail.com
Guest
Posts: n/a
 
      04-11-2005
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!

 
Reply With Quote
 
 
 
 
John Bokma
Guest
Posts: n/a
 
      04-11-2005
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?


What's the name of the CPAN module you are using (to support C# regexp in
Perl)?


--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html

 
Reply With Quote
 
 
 
 
Chris Mattern
Guest
Posts: n/a
 
      04-11-2005
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?"
 
Reply With Quote
 
Tad McClellan
Guest
Posts: n/a
 
      04-11-2005
<> 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
 
Reply With Quote
 
Jürgen Exner
Guest
Posts: n/a
 
      04-12-2005
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tabbing between text inputs with other tags between them Thierry Lam HTML 7 05-02-2009 12:21 PM
Parsing out text from in between HTML tags tgwaltz@googlemail.com Perl Misc 1 01-18-2009 02:13 PM
replacing tags between tags beartiger@gmail.com Perl Misc 9 09-19-2005 02:32 AM
Return HTML between tags with HTML::TokeParser ? Maqo Perl Misc 4 02-23-2005 10:07 AM
RegEx to find CFML tags nested in HTML tags Dean H. Saxe Perl 0 01-03-2004 06:11 PM



Advertisments