Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is this REGEX correct? Or can it be better?

Status
Not open for further replies.

net123

Programmer
Oct 18, 2002
167
US
I would like to avoid extracting certain types of files from my report that end in .cab, .dll, .pl, and so on. I have the following:

REGEX[*\.(cab|bin|pl|dll)$]
[/red]
Will this do the job or am I missing something.

Thank you in advance.
 
Surprisingly it's usually more efficient to check for things separately instead of using the | operator. There's a FAQ on it here at TT

Mike

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

It's like this; even samurai have teddy bears, and even teddy bears get drunk.
 
Also, you need ".*", not just "*". The asterisk is a quantifier meaning "zero or more" of the preceding
character or expression. It doesn't mean "any string of characters" as it does in shell or DOS.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top