Reputation: 327
Can anybody please help on my issue regarding VIM? This is my scenario:
The red redfox02animal jump over the blue reddog01animal.
I tried this search patten
/red.*[0-9]
but the result is "redfox02animal jump over the blue reddog01". What I want are two matched "redfox02" and "redfox01"
Any advice?
Upvotes: 1
Views: 62
Reputation: 195029
this should go too:
/red\D*\d\+
Note that this gives the same matches as Tobi's answer, the first match is:
red redfox02
if you just want to have redfox02
and reddog01
(there is no redfox01
in your input, you cannot get it, as you stated in your question), you can try:
/red[^0-9 ]\d\+
Upvotes: 2