Regex (name and surname)

Hi All,

This is not related with Uipath but Im using a regex solution and I can not handle with the below situation.
I have expressions like
009 G Nantpaipakdee 38 955 722 650-240-0111
002 Eugénie Romette 432 734 782
005 Christina Pandullo 410-527-8241 410-527-8158
020 Joe Smith 410-771-7815 410-527-8771
030 K Kordysiewicz 42 239 3875

And I need to identify name and surname. I have a problem with the first and last example. My regex does not work for them. Any suggestion please?
A-Z(?:\s+A-Z)*(?:\s+[a-z][a-z-]+){0,2}\s+A-Z

Hey niteckam,

here is a simple Regex for the example data: ^(\d{3})\s([A-Za-z\sé])([\d\s-])$
I suggest www.regex101.com to test the Regular Expressions first

Regards

@niteckam Will the data other than the names, contain only numbers and hyphen (-) synmbols ?

Hi it will be always like that
Captur3333e

OK not at all I might have also
Cap1111ture

Hi @niteckam

So may i know what is the name and surname where der are 3 words present

image

For Eg :-

  1. Cecile A. Wattiez
  2. Do not use

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

Always take just two fist words
Do not use - Do not
Cecile A. Wattiez - Cecile A

Hi @niteckam

Below is the Workflow for the same :-
MainPratik.xaml (8.4 KB)
New Text Document.txt (251 Bytes)

Input :-
image

Output :-
image

Mark as solution and like it if this helps you :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

1 Like

Hello @niteckam,
Try this Regex. Here Group1 gives name and Group2 gives Surname

Regards,
@poorna_nayak07

1 Like