list of words

A place to try and solve your RegEx problems.
Post Reply
bluesstruggler
Posts: 1
Joined: Mon Jul 11, 2011 6:49 pm

list of words

Post by bluesstruggler »

Hi,
I am new here and would like to know if Regular expressions
can search a .txt document for a list of tags such as seen below.
I do not want to replace the tags I only want to know if they are present in the document?

Thanks in advance for any help, Blues

NDS13UU000A_WWA80
NDS13UU000A_WWA82
NDS13UU000A_WWA83
NDS13UU000A_WWA84
NDS13UU000A_WWA85
NDS13UU000A_WWA92
NDS13UU000A_WWA93
NDS13UU000A_WWA94
NDS13UU000A_WWA95
User avatar
DV
Posts: 78
Joined: Fri Jun 10, 2011 9:00 am

Re: list of words

Post by DV »

You can use or (|)

eg NDS13UU000A_WWA80|NDS13UU000A_WWA82|NDS13UU000A_WWA83

etc

Or if you want to search a certain range you could use something like -

NDS13UU000A_WWA[8-9][0-9]
User avatar
Fool4UAnyway

Re: list of words, what words?

Post by Fool4UAnyway »

Regular expressions is all about "describing what you are looking for" instead of "typing what you are looking for" as absolute text matches.

In your case, the description could be something like "all words starting with ....." with an "absolute" (typed) text at the dots (NDS13UU000A_WWA) and then "ending with a two digit number", which part could be translated to the regular expression \d\d which simply says: a digit and a digit.

If you can break down your "original list of (possible) items" in simple descriptions, it will not be very difficult to translate each partial description into a regular expression.

See http://www.regular-expressions.info/ for much more information.
Post Reply