I am having some trouble wiht the following, I'm trying to create a regular expression whichi will match
"November 07" or "November '07" but NOT "November 07th 2004"
This is in php and I have so far (using preg_match() ):
"/((Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Sept|Oct|Nov|Dec|January|February|March|April|May|June|July|August|September|October|November|December)([^\w])*(\d)+(\b) )/i"
which works for November '07 but unfortunately also picks up "November 07 2007"
So I'm thinking two filters:
1) how can I avoid matching any (\d) ending in (st|nd|rd|th) (this will avoid "Nov 20th 2007")
2) avoid matching it if the digit following the (\d)+ is another (\d)+ type, but still match the first two words if the term following the (\d)+ is NOT a (\d), so that:
Nov 07 2008 - this wont match (07 is the day)
Nov 07 - this will match ( 07 is the year)
Not sure terms can conditionally be matched by looking ahead …. ?
Help would be greatly appreciated,
gvanto