Re:Regular Expression That Checks If A Number Is Prime
by dllthomas on Friday September 09, 2016 @01:05AM
(#12459743)
When were back-references introduced in sed?
Re:Regular Expression That Checks If A Number Is Prime
by Normal_gaussian on Friday September 09, 2016 @03:19AM
(#12460192)
http://sed.sourceforge.net/sedfaq3.html
> Grouping and backreferences: All versions of sed support grouping and backreferences on the LHS and backreferences only on the RHS.
Re:Regular Expression That Checks If A Number Is Prime
by dllthomas on Friday September 09, 2016 @11:56AM
(#12463377)
I saw that. I wasn't sufficiently confident as to whether it meant "all historical versions" or just "all current versions."
If the former, then it predated perl by quite a bit, of course.
Re:Regular Expression That Checks If A Number Is Prime
by btilly on Monday September 12, 2016 @12:18PM
(#12480984)
Perl started with Henry Spenser's regular expression library, which was written in the mid-1980s. That got used in a lot of places, and may have been used in sed. It includes backreferences. I don't know what predates that.
Perl used that as a starting place and began adding extensions such as the difference between .* and .*?.
So using "non-regular thing" as a regular expression predates Perl. But the dialect we standardized on with the features people now expect is due to Perl's influence.
Re:Regular Expression That Checks If A Number Is Prime
by Normal_gaussian on Friday September 09, 2016 @03:14PM
(#12465250)
Ah I get you.
I've tried finding some source for early versions but all the links I've found are dead. It's an interesting question!
The same features have also been implemented independently many times. For example Ruby, Java and Python all have independent implementations of regular expressions with a lot of the same features.