Non match word list with Regular Expressions

C

Chris Chandler

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
 
J

John Bokma

(e-mail address removed) (Chris Chandler) wrote in
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top