Google
 
Web Ben's Questions and Answers

Monday, April 25, 2005

Regular Expressions

Someone asked me if I could help them with some Regular Expressions on Friday. I ran across several turorials but A.M Kuchling's Howto seems to be one of the better ones, available here:

http://www.amk.ca/python/howto/regex/

As an example, this is the regular expression for a standard 8.3 DOS file name, assuming that file names' case is recorded even though the case is ignored:

[\w]{1,8}.[/w]{1,3}

This means that a file name is made up of between one and eight alphanumeric characters, folowed by a "." followed by between one and three alpha numeric characters.

Once you know where to find the rules for Regular Expressions they are pretty easy. What do you think? Please leave a comment or email your question, which you'd like me to answer for free, to Ben Dash at ben.dash@gmail.com

0 Comments:

Post a Comment

<< Home