Thread: [Solved] Regex-pattern
View Single Post
 
Old 01-05-2025, 01:11 PM
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 gmaxey View Post
batman1,

But how does this pattern ",( [A-Za-zü\-]+)* [A-Z][A-Za-zü\-]+," (or the other) return a match when there is just one name between the commas e.g.,


Test, Jack, end test, test.
In the case of "Test, Jack, end test, test." we have ", Jack," = ", " & A & B & "," - where A = "", B = " Jack"

A = "" means ( [A-Za-zü\-]+) occurs 0 times (* means the expression before it occurs 0 or many times). It doesn't matter what the expression but occurs 0 times it gives an empty string.

B = " Jack" = " J" & "ack" = " [A-Z]" & 3 times "[A-Za-zü\-]"