I recently came across the branch specifier in Vim regex builtins. Vim's help section on \&
contains this:
A branch is one or more concats, separated by "\&". It matches the last
concat, but only if all the preceding concats also match at the same
position. Examples:
"foobeep\&..." matches "foo" in "foobeep".
".*Peter\&.*Bob" matches in a line containing both "Peter" and "Bob"
It's not clear how it is used and what it is used for. A good explanation of what it does and how it is used would be great.
To be clear this is not the &
(replace with whole match) used in a substitution, this is the \&
used in a pattern.
Example usage:
/\c\v([^aeiou]&\a){4}
Used to search for 4 consecutive consonants (Taken from vim tips).