I'm trying to extract all the first names AND the last names (ex: John Johnson) in a big text (about 20 pages).
I used split with \. as separator and there is my regular expression:
\b([A-Z]{1}[a-z]+\s{1})([A-Z]{1}[a-z]+)\b
Unfortunately, I only get all the lines of my text instead of only the first names and last names:
Suddenly, Mary Poppins flew away with her umbrella
Later in the day, John.... bla bla bla
Could someone help me?
[nsregularexpression]have to do with Python?.as separator?.means any character, and your task seems to be searching, not splitting. What's the input you provide to the regex you mention? Directly usingre.searchon the pattern and sentence you mention does identify the name as("Mary ", "Poppins").{1}is implicit;\sand\s{1}both match just one character.