If I have a magic Vim regex in a string literal, is there a way to convert the whole regex into an alternative representation that uses a different magic mode, so I could paste that equivalent regex into source code?
For instance, if I want to convert this magic-mode pattern:
'\m-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>'
to very-magic-mode to make it more readable, something like:
'\v-=<\d+L=>|0[xX][0-9a-fA-F]+>'
I often make mistakes trying to convert them by hand.
[0-9]+
into a no magic one... ;-)