Page 1 of 1

Regex issue

Posted: Fri Oct 19, 2018 12:25 pm
by Debugger
How to find the beginning of a lower case letter that starts with a lowercase letter after the dots and spaces.

example

hey, hey ok. hey

Re: Regex issue

Posted: Fri Oct 19, 2018 11:35 pm
by void
Sorry, I don't understand, can you please give a couple examples and highlight what you want to match.

[a-z] will match lowercase Latin letters (make sure you enable match case from the Search menu).
[. ] will match a dot or space.
[. ]* will match any number of dots and/or spaces.
\b will match a word boundary.

To match a word, that is all lowercase letters and skips starting dots or spaces:
\b[. ]*[a-z]*\b
Note: Please make sure match case is enabled from the search menu.

Re: Regex issue

Posted: Sat Oct 20, 2018 7:28 am
by Debugger
Find:

Code: Select all

Aby ułatwić Ci spełnienie tych wymagań, dodaliśmy na Twoim.blogu powiadomienie o wykorzystywaniu przez Google określonych plików cookie Bloggera i Google, w tym plików cookie usług Google Analytics i AdSense, oraz o innych danych zbieranych przez Google

=================
Find:

Code: Select all

Aby ułatwić Ci spełnienie tych wymagań, dodaliśmy na Twoim blogu .powiadomienie o wykorzystywaniu przez Google określonych plików cookie Bloggera i Google, w tym plików cookie usług Google Analytics i AdSense, oraz o innych danych zbieranych przez Google
OR

Code: Select all

Aby ułatwić Ci spełnienie tych wymagań, dodaliśmy na Twoim blogu .Powiadomienie o wykorzystywaniu przez Google określonych plików cookie Bloggera i Google, w tym plików cookie usług Google Analytics i AdSense, oraz o innych danych zbieranych przez Google
Replace with:

Code: Select all

Aby ułatwić Ci spełnienie tych wymagań, dodaliśmy na Twoim blogu. Powiadomienie o wykorzystywaniu przez Google określonych plików cookie Bloggera i Google, w tym plików cookie usług Google Analytics i AdSense, oraz o innych danych zbieranych przez Google
Each text is different. It's not the same, please look at it.

Re: Regex issue

Posted: Sat Oct 20, 2018 7:58 am
by void
Please try searching for:

Code: Select all

 \.([a-z]+)
space = match space
\. match a literal .
() = capture match inside bracket to be recalled later with \1
[a-z] match character a-z
+ match previous element one or more times. In this case match a-z once or more.

Replace with:
\. \1

Note: This won't capitalize the first letter of the word, ie:
blogu .powiadomienie
is replaced with:
blogu. powiadomienie

Re: Regex issue

Posted: Sat Oct 20, 2018 10:40 am
by Debugger
\.([a-z]+)

It works in text sentences, but in a regular expression it must still be "ignore/exclude all urls". because the text file also contains URLs, and this regex unnecessarily matches it.

Re: Regex issue

Posted: Mon Oct 22, 2018 3:59 pm
by NotNull
I think you forgot the space (" " or \s). There are no spaces in URL's
Try
\s\.([a-z]+)
?

Re: Regex issue

Posted: Tue Oct 23, 2018 9:25 am
by Debugger
NotNull wrote:I think you forgot the space (" " or \s). There are no spaces in URL's
Try
\s\.([a-z]+)
?
The sentences look correctly written, because they do not find incorrectly inserted dots or commas in sentences.

And another question:
And how do only delete empty spaces at the end of a sentence?


Image

Re: Regex issue

Posted: Tue Oct 23, 2018 12:24 pm
by NotNull
Debugger wrote:And how do only delete empty spaces at the end of a sentence?
Try searching for
\s{1,}$
; replace it with nothing (effecively deleting the spaces at the end.
Debugger wrote:And another question:
What was the first question? :?

Re: Regex issue

Posted: Tue Oct 23, 2018 3:00 pm
by Debugger
The first question was asked and solved, actually there are no more questions. If I want to ask something again, I will create a new topic. Thanks for all the help.

Re: Regex issue

Posted: Wed Oct 24, 2018 1:04 pm
by Debugger
Again, I noticed that the number of spaces between the dot may be different, and therefore it still does not work as expected, similarly with commas!

Re: Regex issue

Posted: Wed Oct 24, 2018 3:59 pm
by NotNull
Use \s{1,} instead of \s to match multiple spaces (at least 1)

Re: Regex issue

Posted: Wed Oct 24, 2018 4:09 pm
by Debugger
NotNull wrote:Use \s{1,} instead of \s to match multiple spaces (at least 1)
or
\s{2}$

Find:
Wszystko, czego naprawdę pragniesz,na pewno wydarzy
OR
Wszystko, czego naprawdę pragniesz ,na pewno wydarzy

Replace with:
Wszystko, czego naprawdę pragniesz, na pewno wydarzy

I need a regex to correct the placement of the comma in the text

============
AND FIND MORE DOTS:
Wszystko, czego naprawdę pragniesz...na pewno wydarzy

Replace with:
Wszystko, czego naprawdę pragniesz... na pewno wydarzy