I have the following in a text file:
This is some text for cv_1 for example
This is some text for cv_001 for example
This is some text for cv_15 for example
I am trying to use regex cv_.*?\s to match cv_1, cv_001, cv_15 in the text. I know that the regex works. However, it doesn’t match anything when I try it in Vim.
Do we need to do something special in Vim?
The non-greedy character
?doesn’t work in Vim; you should use:…instead of:
Here’s a quick reference for matching: