Re:Regex that only matches itself
by mcpherrinm on Friday November 11, 2016 @03:15PM
(#12933926)
It's a pretty boring question if you don't make that requirement, though. The whole exercise is arbitrary, so it doesn't bother me.
Perl's use of this syntax had ancestors in awk, sed, ed, and qed - originally just for string replacements in qed until Ken Thompson wrote a version that did regexps too. It dates back to 1967. https://www.bell-labs.com/usr/dmr/www/qed.html
Deutsch&Lampson's original paper on qed showing s/// used for string substitution prior to it gaining regexps is here: http://research.microsoft.com/en-us/um/people/blampson/04-On...
Incidentally the name 'grep' originated here, 'G/RE/P' was a qed command to do a Global Regular Expression match and Print the matches.
Okay, I'll quote some more from the question:
> […] for the sake of the challenge, let the expression be delimited (starting symbol, expression, ending symbol ex: /fancypantpattern/ or @[^2048]@), if you want to argue quotes as your delimiter, so be it. I think given the apparent difficulty of this problem it won't make much of a difference.
Edit: looks like slashes weren't even used in the example.