Many Unix tools' regular expression syntaxes are often the POSIX-codified Basic and Extended Regular Expressions (BRE and ERE, respectively), and, in some modern implementations, Perl-style (PCRE being an implementation of this). Is there a one-to-one correspondence between Vim's levels of magic and such externally defined, but well-known, classes? It looks like \m is BRE and \v is ERE, except POSIX doesn't include lookarounds. If such a correspondence exists, is it defined somewhere? pattern.txt has only one mention of POSIX.Or do we have to stick with magic to describe Vim regular expressions?
Are Vim's regex magics compatible with well-known regex classes?
regular expression
In summary, no. Vim's regex is a unique flavour, and there are no options to make it behave more like another flavour.I think this is a good thing.MagicThe 'magic' option doesn't change the flavour of regex that Vim uses. It simply inverts the behaviour of many \-escaped atoms.For example, by default, + is a literal + character, where \+ means one or more of the preceding atom. In contrast, * means zero or more of the preceding atom, while \* is a literal *. Many people find this quite confusing. Using \v in your pattern makes it a bit more consistent. :help 'magic' gives a good summary:after:    \v       \m       \M       \V         matches ~                'magic' 'nomagic'          $        $        $        \$         matches end-of-line          .        .        \.       \.         matches any character          *        *        \*       \*         any number of the previous atom          ()       \(\)     \(\)     \(\)       grouping into an atom          |        \|       \|       \|         separating alternatives          \a       \a       \a       \a         alphabetic character          \\       \\       \\       \\         literal backslash          \.       \.       .        .          literal dot          \{       {        {        {          literal '{'          a        a        a        a          literal 'a'Personally, I think the default behaviour is nice for code files, where it's not uncommon to search for things like foo(, using the literal (.Vim's own regex flavourI've witnessed many people wishing Vim supported PCRE. Personally, I wish other tools supported Vim's flavour of regex. It has some capabilities that are either impossible or too cumbersome to achieve in PCRE.Impossible in PCRELookaround is a common feature where you can assert that a pattern either does or does not match before or after the pattern you're trying to match. For example, the PCRE pattern q(?!u) (or Vim regex pattern qu\@!) matches a q that's not followed by a u. (This is more correct than q[^u], which requires that there is some character after the q.)Variable-length negative lookbehindPCRE, and many other flavours, have a restriction that a negative lookbehind pattern must be of a fixed length. That means that a pattern like (?<![a-z]{3})foo, meaning the string foo not preceded by exactly 3 lowercase letters) is fine, but (?<![a-z]+)foo (meaning the string foo not preceded by any number of lowercase letters) is not.This restriction doesn't exist in Vim. In Vim, a pattern like \([a-z]\+\)\@<!foo, while maybe a bit ugly to look at, is perfectly valid.Easier in Vim regexSome things are a lot nicer in Vim's flavour of regex.Start and end of match anchorsThe most notable, in my opinion, are the \zs and \ze anchors. These allow you to specify the start and end of the match. For example, foo(\zs.*\ze) matches only what's between the ( and ) in a function call like foo(...). This can be done in PCRE, but it requires the use of lookaround, which is slightly tedious: (?<=foo\().*(?=\))Prefix matchingAnother cool thing that Vim can do is match any prefix (including the empty prefix) of a particular sequence of characters. For example, to match on f, fo, foo, or food, the pattern f\%[ood] can be used. In PCRE, such a pattern would look like f(o(od?)?)?. (Imagine that for a longer string!)Matching cursor, line, and column positionsVim's regex has some anchors for matching positions in the buffer.\%23c matches column 23\%<23c matches before column 23\%>23c matches after column 23\%16l matches line 16Similar to column, there are anchors for before or after a line number\%# matches the cursor positionThis is useful for things like highlighting trailing whitespace except when you're typing at the end of the lineI think it's worth-while to embrace Vim's flavour of regex. It's well-suited for use in a text editor used primarily for programming, and it's quite powerful.