Non match word list with Regular Expressions

Discussion in 'Perl Misc' started by Chris Chandler, Aug 18, 2004.

  1. 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
     
    Chris Chandler, Aug 18, 2004
    #1
    1. Advertising

  2. Chris Chandler

    John Bokma Guest

    (Chris Chandler) wrote in
    news::

    > 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
     
    John Bokma, Aug 18, 2004
    #2
    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:
    619
    Jay Douglas
    Aug 15, 2003
  2. Replies:
    2
    Views:
    424
    George Sakkis
    Jul 13, 2005
  3. mikko.n

    Regular expressions (multiple match problem)

    mikko.n, Apr 2, 2008, in forum: C Programming
    Replies:
    5
    Views:
    486
    Antoninus Twink
    Apr 2, 2008
  4. ccm news
    Replies:
    0
    Views:
    3,089
    ccm news
    Jan 15, 2009
  5. Noman Shapiro
    Replies:
    0
    Views:
    240
    Noman Shapiro
    Jul 17, 2013
Loading...

Share This Page