NYCPHP Meetup

NYPHP.org

[nycphp-talk] regexp: feeling stupid

David Sklar sklar at sklar.com
Wed Mar 17 15:16:01 EST 2004


> many thanks.  i was trying in my head to create a match for the 
> beginning of the tag, then anything that is not "</sup>", and then </sup>.
> 
> many times, like now, i find that my strategy is wrong with pattern 
> matching.

Thinking like a regex would is a weird way to think that requires a lot 
of adjustment from normal human thought.

The adjustment, IMHO, is complicated when you want to express a negation 
in your pattern (like "anything that is not '</sup>') because the ways 
to do that in regex land are tucked into twisty, punctuation-riddled 
back alleys.

"Mastering Regular Expressions" by Jeffrey Friedl (http://regex.info) is 
  the place to start if you want to climb the regex mountain, though.

David





More information about the talk mailing list