only matches between an alphanumeric character and a non-alphanumeric character (or the start/end of string). Therefore, it doesn't match after a .
, unless an alphanumeric character immediately follows that dot.
If your intent is to make sure that no non-whitespace character follows after the dot, then you can specify that using a negative lookahead assertion:
(?i)i.v.(?!S)
(?!S)
means "Assert that the next character is not a non-whitespace character".
This may sound a bit convoluted - why the double negative? Why not (?=s)
which means "Assert that the next character is a whitespace character"? Well, there is a subtle difference: The second version requires a whitespace character to be there; that means the regex would fail to match at the end of the string. The first regex handles that corner case as well.
If you generally want the concept of "word boundary" to mean "space-delimited", then you need to replace the first
as well:
(?i)(?<!S)i.v.(?!S)
or the regex will match sam.i.v.
which you don't seem to want it to.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…