basic expression

Tips on writing regular expressions for searching the post list

Moderators: Quade, dexter

basic expression

Postby AreLefty » Thu May 02, 2002 12:45 pm

How would I filter filename such as the following in r4.0

read01.mpg
read03.mpg
read10.mpg
read11.mpg

and
cin_deva.avi
cin_devb.avi
cin_devc.avi
cin_deve.avi
cin_devf.avi
AreLefty
 

RE: basic expression

Postby dexter » Thu May 02, 2002 12:53 pm

LAST EDITED ON 05-02-02 AT 11:55 AM (EST) How about

read[0-9][0-9]\.mpg

and

cin_dev[a-z]\.avi

Items in the bracket specify a range of characters to match for that position in the string. The backslash escapes the dot which is a reserved token matching any single character.
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 22 guests