Thread: [Solved] Regex-pattern
View Single Post
 
Old 01-05-2025, 06:00 AM
batman1 batman1 is offline Windows 11 Office 2013
Advanced Beginner
 
Join Date: Jan 2025
Posts: 57
batman1 is on a distinguished road
Default

Quote:
Originally Posted by vivka View Post
Hi! I support Greg's idea about the pipe symbol or upright slash (|), which means "or". It seems redundant because the asterisk (*) that follows the capturing group means zero or unlimited times. So,
Code:
, [A-Z][A-Za-zü\-]+( [A-Za-zü\-]+)* [A-Z][A-Za-zü\-]+,
is OK.

I read Greg's post (#9) and understood that he wants to find ", John," in ", John, some text some text", i.e. find the result of the name even when there is 1 word between the characters "". That's why I gave this pattern and not another. If Greg really wants 1 word, then your pattern will not meet his requirement - it will not find ", John," in ", John, some text some text"


It is not without reason that I gave this pattern and not another one