I have this text:
Retailer-ul Amazon foloseste metode severe pentru a-si descuraja etc. angajatii din depozite sa nu mai fure din produse. Pe ecrane li se arata siluete de
You need to wrap the [a-z]
into a positive lookahead:
\b[a-z]+\.\s(?=[a-z])
See the regex demo
The lookahead construct just checks if some pattern defined inside it appears to the right of the current location. So, (?=[a-z])
checks if there is a lowercase ASCII letter right after the whitespace matched with \s
. If there is a lowercase, a match is returned (and the replacement occurs), if it does not find the small letter, the match is failed, no replacement occurs.