Quote:
Originally Posted by lomkiri
You want to see if your acro is at the end of a paragraph (A.B.</p>) or of a sentence (A.B. Then something) or if the is a word in lowercase
I propose you a regex function, working with this regex :
See if you want to consider other cases. Notice that, e.g., A.B. Lda will give AB. Lda, because of the capital letter of the next word
|
Thanks
This looks a LOT easier than the brute force way I tried
I can single step through and address the A.B. Lda case
Code:
<!-- CASE 1
TRAILING SPACE FOLLOWED BY CAPITAL LETTER SO ASSUME END OF SENTENCE
AND LEAVE LAST PERIOD -->
<!-- CASE 2
NO TRAILING SPACE SO ASSUME END OF PARAGRAPH
AND LEAVE LAST PERIOD -->
<!-- CASE 3
HAS TRAILING SPACE SO ASSUME IN MIDDLE OF SENTENCE WITH NO PERIODS -->
I have 3 cases and your function works great on case 1 and case 2. Doesn't seem to do anything for case 3. Can you tweak it a little for me please?