. -, :
$& returns the entire matched string (some systems its $0)
1
s/[.*+?|()\[\]{}\\]/\\$&/g
An unclear fact: in Perl, there is a quotemeta function ("your string") that does this or it can be embedded in a regular expression with \ Q. I love Perl.
As a side note, he may have abandoned carret ^ and perhaps, but not sure, $
The fact that there is no built-in or built-in method can be bad. And to avoid metahars like this one needs to be thought out, because fragments of regular expressions can be problematic.
source
share