
April 21st, 2004, 02:38 AM
|
|
Contributing User
|
|
Join Date: Feb 2004
Location: London, England
|
|
|
The problem is that regexObj.match() only matches at the start of the string. What you want to use is regexObj.search(), which will find the pattern anywhere in the string.
Also, if you use the matchObj.groups() method then you need to define at least one group in you pattern, e.g. '(a)', otherwise it will always return an empty tuple. If you just want to return the matched string then use matchObj.group().
Dave - The Developers' Coach
|