This is a discussion on RE: [PHP] REGEX: grouping of alternative patterns within the PHP General forums, part of the PHP Programming Forums category; On 30 October 2007 11:07, Stijn Verholen wrote: > Hey list, > > I'm having problems with grouped ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
On 30 October 2007 11:07, Stijn Verholen wrote:
> Hey list, > > I'm having problems with grouped alternative patterns. > The regex I would like to use, is the following: > > /\s*(`?.+`?)\s*int\s*(\(([0-9]+)\))?\s*(unsigned)?\s*(((auto_i > ncrement)?\s*(primary\s*key)?)|((not\s*null)?\s*(d efault\s*(`. > *`|[0-9]*)?)?))\s*/i Since all the parts beyond the id and datatype are optional, I don't see how this can ever not match. Please define more accurately what you mean by "doesn't match". Cheers! Mike --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, JG125, The Headingley Library, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: m.ford@leedsmet.ac.uk Tel: +44 113 812 4730 Fax: +44 113 812 3211 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm |