Just when you thought regular expressions were powerful and confusing enough, comes Reversing regular expressions. The idea is that if a match is too hard to make going forward through the string, then reverse the string first, apply a reversed regex to it, and finally reverse the resulting match. Wow.

Update (thanks to Simon, who shows Python for the technique): I forgot to mention that this technique is called "sexeger" ("regexes" backwards, get it?), and here's japhy's authoritative treatise on the subject.

tagged: , » 1 reaction

Comments

[gravatar]
Ben Poole 4:08 AM on 17 Sep 2003

* pop *

Oops, there goes my brain... ;-)

Add a comment:

name
email
Ignore this:
not displayed and no spam.
Leave this empty:
www
not searched.
 
Name and either email or www are required.
Don't put anything here:
Leave this empty:
URLs auto-link and some tags are allowed: <a><b><i><p><br><pre>.