In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Use RegEx to extract name from a string that contains NAME + ADDRESS

gurpreet-singh
7 - Meteor

Hi, 

 

I have a few strings like:

 

- Mike Jason new port street 1345 adilli

- Sam Curran way walk park duncan valley

- Mike Jason P Fallon sweetcan valley

 

How can I use RegEx to extract just name "Mike Jason" & "Sam Curran" & "Mike Jason P Fallon"

 

Can some one please help?

1 REPLY 1
jdunkerley79
ACE Emeritus
ACE Emeritus

If you can guarentee the casing as per your examples:

 

TRIM(REGEX_Replace([Input], "^(([A-Z][a-z]* ){1,}).*?$", "$1", 0))

should get the names (assumes just alphabet characters in names you may need to widen and all start with capital)

 

It is relying on the fact that names start with a capital letter and it will stop at the first word which doesn't.

 

Sample attached.

Labels
Top Solution Authors