Stuart McLachlan
stuart at lexacorp.com.pg
Tue May 27 16:41:15 CDT 2003
On 27 May 2003 at 21:43, Martin Reid wrote: > [a-zA-Z]+\w*\d+\w*" > > What does the above regular expression do??? > A list of characters enclosed by [ and ] matches any single character in that list; if the first character of the list is the caret ^ then it matches any character not in the list. + The preceding item will be matched one or more times. * The preceding item will be matched zero or more times. The symbol \w is a synonym for [[:alnum:]] and \W is a synonym for [^[:alnum]]. You've got me beat with the "\d" are you sure about that one? So: [a-zA-Z]+ any string of at least one alpha character \w* followed by zero of more alphanumerics \d+ followed by one or more "\d"s ??????? \W* followed by zero or more non-alphanumerics -- Lexacorp Ltd http://www.lexacorp.com.pg Information Technology Consultancy, Software Development,System Support.