I need to write a regex that matches the word versus
, verse
, vs.
, v.
, v
but v
should not be jumbled in words.
@"\b((.*?)" + Regex.Unescape(xz) + @"[.,:/s]?)\b", RegexOptions.IgnoreCase))
Here I'll pass the array and test it.
I need to write a regex that matches the word versus
, verse
, vs.
, v.
, v
but v
should not be jumbled in words.
@"\b((.*?)" + Regex.Unescape(xz) + @"[.,:/s]?)\b", RegexOptions.IgnoreCase))
Here I'll pass the array and test it.
This will get you close:
\b(?:(?:vers(?:e|us)|v)\b|vs\.|v\.)
One difficulty is in word boundaries vs. (heh) words that end in a period. See Regex using word boundary but word ends with a . (period) for other options.
Note that "verse" can also mean "poetry" so there could be false positives.