Reputation: 2615
I use vi at work and i have to search for a string of specific letters & numbers such as these:
UTL41650
adr21100
aTL31901
there are always (3)Letters and (5)Numbers. Is there a way to search for these strings easily? Maybe with regex or something else.
Upvotes: 2
Views: 3896
Reputation: 382274
Just type
/\v[a-zA-Z]{3}\d{5}
The \v
activates the very magic mode to avoid escaping here. What follows is probably self-explanatory, assuming you know that \d
is a digit in regular expressions.
Documentation on searching in vim
Upvotes: 5