in reply to Elegant way to escape a string in a regex
I would not use regex for replacing fixed strings like this but rather substr. That means that this problem of avoiding interpolation etc. just vanishes. As a bonus it should usually be faster too.
🦛
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Elegant way to escape a string in a regex
by bliako (Abbot) on Apr 14, 2025 at 22:31 UTC | |
by LanX (Saint) on Apr 14, 2025 at 23:34 UTC | |
Re^2: Elegant way to escape a string in a regex
by Anonymous Monk on Apr 15, 2025 at 19:44 UTC |