exact match

Tips on writing regular expressions for searching the post list

Moderators: Quade, dexter

exact match

Postby jimfr » Tue Jan 15, 2002 10:09 pm

Sorry, but I can't find the regular expression tips page on the website any more...

Can someone tell me how to do a file filter that matches an exact file name? That is, if the filter is Mysong.mp3, I want it to match Mysong.mp3, but not 1Mysong.mp3 or Mysong.mp34567?

Thanks,

jim
User avatar
jimfr
Seasoned User
Seasoned User
 
Posts: 174
Joined: Tue Oct 16, 2001 10:07 pm

Registered Newsbin User since: 04/01/03

RE: exact match

Postby dexter » Wed Jan 16, 2002 12:13 am

Hmm, I can't find it either. I must have lost it the last time I revamped the site. To get an exact match with white space on either side, [ ]Mysong\.mp3[ ] where there is a space between the brackets. The backslash escapes the period because in regex, the period means "Match any single character" by itself.
User avatar
dexter
Site Admin
Site Admin
 
Posts: 9514
Joined: Fri May 18, 2001 3:50 pm
Location: Northern Virginia, US

Registered Newsbin User since: 10/24/97


Return to Regular Expressions

Who is online

Users browsing this forum: No registered users and 29 guests