
![]() |
nutballs
Normally I am the goddam
regexgenious, but for some reason this is giving me a headache. I am trying to match content that has a long date like january 1st, 2007.$regstr='#(?:January|March|April|May|June|July|August|September|October|November|December)W+d{1,2}.{1,4}d{2,4}#is'; if (preg_match($regstr,$s) != 0) echo 'date'; pass it this and it matches: Posted Tuesday, November 20th, 2007 at 11:44 am Filed Under Category: awesome dude! Pass it this and it doesnt: morgan 13 November 20th, 2007 4 at 7 4:16 pm 5 2a 3c Ahh… so your phone DOES support MP3 dimitry12
if("morgan 13 November 20th, 2007 4 at 7 4:16 pm 5 2a 3c Ahh. so your phone DOES support MP3" =~ m/(?:January|March|April|May|June|July|August|September|October|November|December)W+d{1,2}.{1,4}d{2,4}/is){ print "pass! "; }else{ print "no! "; }' prints "pass!" nutballs
err... what the fish is that magic syntax you're using?
hmm. it passes? I wonder if those spaces are actually spaces. Obviously when I copy paste them into the forum they probably get converted somewhere along the lines. I gotta check that out. thanks for testing it. perkiset
Cripes Dim, I can't find that syntax anywhere - is that "=~" equal to a
regex? I'm not at mymachine so I cant test...Feckin' learnsomething every day...short outline please: dimitry12
it's
perl, sorry![]() chide
Yummy
perl![]() |

Thread Categories

![]() |
![]() |
Best of The Cache Home |
![]() |
![]() |
Search The Cache |
- Ajax
- Apache & mod_rewrite
- BlackHat SEO & Web Stuff
- C/++/#, Pascal etc.
- Database Stuff
- General & Non-Technical Discussion
- General programming, learning to code
- Javascript Discussions & Code
- Linux Related
- Mac, iPhone & OS-X Stuff
- Miscellaneous
- MS Windows Related
- PERL & Python Related
- PHP: Questions & Discussion
- PHP: Techniques, Classes & Examples
- Regular Expressions
- Uncategorized Threads