Hacker News new | ask | show | jobs
by dazmax 3484 days ago
Is ed where the slash for regex matching originated or does it go back farther?
2 comments

Close; it was one of the Bell Labs versions of QED — 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.
Does 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.
I'm not aware of any.
You 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.