4 ms·
Is ed where the slash for regex matching originated or does it go back farther?
by dazmax 10y ago
Is ed where the slash for regex matching originated or does it go back farther?
- gkya 10y agoYou can use any character instead of / there. I prefer comma as its easier to type IMO. But slash is too and it's quite distinctive and easy to type too.
- kps 10y agoClose; it was one of the Bell Labs versions of QED — https://www.bell-labs.com/usr/dmr/www/qed.html https://www.bell-labs.com/usr/dmr/www/qed.html — I suspect but am not sure that Ken Thompson's CTSS version, that introduced regular expression text editing, used slash. The original Deutsch/Lampson QED used colons or square brackets for searches (fixed strings, not regular expressions) but did use slashes as the substitution delimiter, which may have inspired Thompson to use the same character for both search and replace.
- cylinder714 10y agoDoes QED source code exist anywhere? A senior developer at SCO gave me a copy of the manual years ago but I've never had an opportunity to try it.
- kps 10y agoI'm not aware of any.