Regular Expression in Vim that will count 1 or colon
I am rather new to using vim with regular expressions and I need to count specific entries in a .csv file The entries are in this form:
9,1,8-Mar-11,high,A2,mid,500,1000,0.143494345,0.153521446,1121.386992,409.6833333,, 9,2,8-Mar-11,high,A2,mid,500,1000,0.180015537,0.256840072,1190.977918,420.8229933,1, 9,3,8-Mar-11,high,A2,mid,500,1000,0.250273568,0.16378268,1061.417761,419.1692065,,1
I need to count the number of 8-Mar-11, A2 conditions which have either ,, or ,1 (,|1) or (,|1),1 on the end of the lines.
here is the regular expression that i use in vim to get some count data:
What I would like to know is there a way to use either in vim? like:
Any advice or help is greatly appreciated!
When you're composing a regular expression which is searching for one character or another, alternation using pipes is overkill. Use a character class instead:
VIM regexes are weird and confusing. You have to escape the | as \| for or