0

I started learning some Perl Compatible regex and yet I've seen various codes in the last years (Bash, APCRE, Nginx, JavaScript, ) and in some I clearly remember seeing a escaping metacharacter right before equal signs while in some others I haven't seen that.

Is it generally a necessity in regex or some kind of a best practice?

Osi
  • 1
  • 3
  • 9
  • 30
  • Do not escape `=`, it is not a special regex metacharacter. The best practice is to avoid escaping chars that are not special. – Wiktor Stribiżew Jan 11 '18 at 12:57
  • 2
    in vim, patterns starting with `\v` is *very magic* when `=` means `{0,1}`. you can say that's vim style regex (just like PCRE). voted to reopen. – pynexj Jan 11 '18 at 13:27
  • according to vim's manual, *Use of `\v` means that in the pattern after it all ASCII characters except `0-9`, `a-z`, `A-Z` and `_` have a special meaning. "very magic"* – pynexj Jan 11 '18 at 13:29

0 Answers0