@withaveeay @kensanata Well, after reading this, I have to confess that in 25+ years, I have never used backreferences in a regex.
Conversation
Notices
-
Jens FinkhΓ€user π» (jens@social.finkhaeuser.de)'s status on Saturday, 22-Jan-2022 20:10:33 UTC Jens FinkhΓ€user π» -
Matthew "Smiffy" Smith (grumpysmiffy@aus.social)'s status on Saturday, 22-Jan-2022 20:10:31 UTC Matthew "Smiffy" Smith @clacke @kensanata @withaveeay @jens I've been using them what feels like forever, but never seen any theory, so that's my reading for this evening.
-
Santa Claes πΈπͺππ°π (clacke@libranet.de)'s status on Saturday, 22-Jan-2022 20:10:32 UTC Santa Claes πΈπͺππ°π Speaking from an informatics point of view, regular expressions don't have back references.
In practice, of course, most practical implementations of regex-likes have them as an extension.
I use back references more than you ... maybe once every two years. -
Zack Weinberg (zwol@hackers.town)'s status on Sunday, 23-Jan-2022 02:06:11 UTC Zack Weinberg @clacke @kensanata @withaveeay @jens I think the most frequent thing I use back references for is /(["']).*?\1/ which is really just a less repetitive way to type /".*?"|'.*?'/ (also if I need to capture the contents of the string itβs the same match group either way) but I have no idea whether common regex engines can see that.
-
Santa Claes πΈπͺππ°π (clacke@libranet.de)'s status on Sunday, 23-Jan-2022 02:06:11 UTC Santa Claes πΈπͺππ°π @zwol Oh yeah, that's an interesting question, how much optimization an engine might be able to do.
@kensanata @withaveeay @jens
-