Hi I am using the following regex:
([a-z]{1,}|[\u00F0-\u02AF]{1,})(\,|\.)*([^\xa0])(\d+)(?:,\s*(\d+))+\s*(\ba\b|\bb\b|\bc\b|\be\b|\bf\b)*
replaced by:
`$1 $4,$5$6``
(where between $1 and $4 there is a \xa0)
I do this in order to correct incorrect or olddated citations and insert \xa0 between the number and the letter:
Joh 1. 3 c → Joh 1,3c
If I remember well I inserted ([^\xa0]) so that It will not go over already done replacements.
Now, I have recently noticed that when the searched pattern is between brackets, this works as a breeze: (Joh 1. 3 c)
However, when the expression is found in a text AND the " c" is missing as in word Joh 1. 3 word
, the space following 3
is also selected and then gobbled by the replacement.
Any idea how to avoid selecting the space?