in reply to Perl Regular Expression inconsistency

The only time '{' needs to be escaped is when it is followed by a set of digits, followed by an optional comma and more digits, followed by a closing '}'. If you don't want that sequence of characters to be interpreted as a quantifier, all you need to do is escape the leading '{'. (This is ignoring places where {...} is part of an escaped expression like \p{Xyz} and \N{CHARACTER}.)

'{' is only a metacharacter in a very specific circumstance. You almost never need to backslash it in a regex.


Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart