Need help with regex or solution

xirosxvi

Client
Регистрация
24.09.2019
Сообщения
20
Благодарностей
0
Баллы
1
Hello!

I'm stuck on part of my script. I currently have long texts, and I want to delete words that start with a capital letter ONLY if the word is not after a . ? (to avoid breaking sentences)

For example:

hello, i'm a Marine. (remove Marine)
hello, i'm pierre. Hi, guys. (No remove Hi)

Do you have any ideas?

Thank you!
 

orka13

Client
Регистрация
07.05.2015
Сообщения
2 167
Благодарностей
2 169
Баллы
113
Код:
(?<=[^\.\!\?]\ +)[A-Z]\w*
 

xirosxvi

Client
Регистрация
24.09.2019
Сообщения
20
Благодарностей
0
Баллы
1
perfect :O
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)