TaciturnThu 6 Mar 2008
David and I were discussing regexes and he wondered if it was possible to write two regexes so that each one matches the other but not itself. In programmer- and shell-readable terms, given the variables To give it a bit more of a concrete scope, I decided that it should use extended regexes, because they have a good balance of power, usefulness, and sanity. Secondly, to avoid the easy solution of To give readers a chance to solve this themselves, I'll disguise the spoilers below in white-on-white text. Highlight the text to read it.
The key is to use inverse classes. As a result I came up with I then posed the question to #humbug, Clinton Roy got a solution pretty quickly: Doing the same when anchors are prohibited seems to be more difficult, although I haven't thought about it long enough to be satisfied that it's impossible. By the way, setting
Also available in
|
Comments
See also: http://www.pixelbeat.org/scripts/findrepo