I've been trying to make a few of functions based on RegEx
and most of them use \Q
and \E
as some of the RegEx
pattern
is user input.
So, let's say hypothetically that we're using the delimiter
/
and want to match it against /
the function would construct something amongst the lines of /\Q/\E/
.
I'm not sure why /\Q/\E/
doesn't match /
but with every other delimiter it does, unless you use the same delimiter as input
.
Maybe, it considers the delimiter the end, even though, it's in a literal-only block and the escape as literal. Not sure, tried a bunch.
Hopefully someone can push me into the right direction as to what workarounds there are for this issue.