I am looking to create a regex that allows either one or two word boundaries, but not zero.
For example, for the word term:
a term is<-- yes, space before and space after (two boundaries)the terms are<-- yes, space before (one boundary)the midterm was<-- yes, space after (one boundary)the midterms were<-- no (zero word boundaries)
Would would be the best regex for this? My initial thinking was:
\bterm|term\b|\bterm\b# (no?on\b)
But this seems way too verbose. What might be a better one?