What is the correct way to escape a hash character followed by quantification with braces in a regex? I want to detect a sequence of hash characters repeated within a given number of times. I want something like:
/#{1, 6}/
without interpolation. I cannot turn off interpolation entirely for the regex because I use it in other portions of the regex.
Use back-slash
\as the escape character e.g.