Need help with regex finding all punctuation out of place

tharrkun

Client
Регистрация
05.09.2016
Сообщения
64
Благодарностей
5
Баллы
8
Hi,
so I've been working on a project that scrapes content, removes duplicates, spins the articles and then uses a grammar checker to fix all the issues. But there's one thing the grammar checking tool doesn't do - it won't fix the punctuation that is out of place.
For example, I have a sentence that starts with an exclamation point or a dot between two linebreaks. I've never been good at regexp and I've been trying to find a solution but with no luck so far. Could anyone help me out with this, please?
Here's an example:

Код:
!Lorem ipsum dolor sit amet, consectetur adipiscing elit

.

In cursus quam eu ante convallis, vitae hendrerit libero egestas. Nam dictum iaculis urna eget blandit. Nam malesuada sollicitudin iaculis. Curabitur quis augue ullamcorper, congue ante quis, pellentesque mi.

Maecenas eget nisi at tellus tempor lobortis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Vivamus euismod ligula ipsum, sed efficitur mauris suscipit et. Nulla pretium blandit erat at condimentum. Etiam vitae tincidunt enim. Ut ultricies eleifend ligula a luctus. Pellentesque non blandit lacus. Quisque in libero nibh. Sed ornare elit id est luctus, quis imperdiet justo tempor. Nunc tortor ex, lacinia faucibus consequat eu, sollicitudin ut eros. Nulla dapibus dolor ac mauris ultrices, sit amet commodo lorem sagittis.
 

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