Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Non match word list with Regular Expressions

Reply
Thread Tools

Non match word list with Regular Expressions

 
 
Chris Chandler
Guest
Posts: n/a
 
      08-18-2004
Hello

Is it possible to include a list of words NOT to match in a regular
expression?

I have used a simple expression such as:

</?(table|tbody|thead|tr|td).*?>

to match any of these html tags (or closing tags).

Is it possible to do the reverse and specify a list of terms NOT to be
matched, ie. Don't match <b> or <ul> tags but match all others?

Regards
Chris Chandler
 
Reply With Quote
 
 
 
 
John Bokma
Guest
Posts: n/a
 
      08-18-2004
http://www.velocityreviews.com/forums/(E-Mail Removed) (Chris Chandler) wrote in
news:(E-Mail Removed) om:

> Hello
>
> Is it possible to include a list of words NOT to match in a regular
> expression?
>
> I have used a simple expression such as:
>
> </?(table|tbody|thead|tr|td).*?>
>
> to match any of these html tags (or closing tags).
>
> Is it possible to do the reverse and specify a list of terms NOT to be
> matched, ie. Don't match <b> or <ul> tags but match all others?


Use an HTML parser for HTML.

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

 
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
How to print all expressions that match a regular expression hzhuo1@gmail.com Python 23 02-08-2010 05:17 AM
Parse::Recdescent match word exactly with regular expressions ccm news Perl 0 01-15-2009 12:34 PM
Regular expressions (multiple match problem) mikko.n C Programming 5 04-02-2008 10:14 PM
How to match literal backslashes read from a text file using regular expressions? cricfan@gmail.com Python 2 07-12-2005 11:53 PM
Add custom regular expressions to the validation list of available expressions Jay Douglas ASP .Net 0 08-15-2003 10:19 PM



Advertisments