Using VI to search for specific patterns

So this is a short little something I was working on tonight. Yes tonight as in a saturday night. I am a workaholic.

Anyway, if you would like to search for the following pattern using VI or if you would like to use syntax highlighting using your own vim file.

Patter: ##/##/##@##:##:##

Search command:

:/[0-9]./[0-9].{3}.@[0-9].:[0-9].:[0-9]

or the much cooler one

:/d./d./d.@d.:d.:d

For all your wildcard needs, remember to refer back to the awesome VI doc site here. Enjoy.

~david macias

Leave a Reply