RE: [PHP] REGEX: grouping of alternative patterns

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 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-30-2007
Ford, Mike
 
Posts: n/a
Default RE: [PHP] REGEX: grouping of alternative patterns

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
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:34 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0