REGEX doesn't work

Could you guys please help, me? I build a regex expression in “”, but when I try to use “Matches” activity in UiPath it doesn’t work. Could you please help me with it and explain to me why it didn’t work?

I want the person’s fullname in uppercase, in this case “STEFFANY LOPES ROSARIO”
Regex used: \w[A-Z]+\s\w[A-Z\s]+

Text below:
Ao(s) 20 dia(s) do mês de Maio de 2008, nesta cidade do (e) Rio de Janeiro e em cartório, compareceu Anderson de Rosario Santos, natural do (e) Sxxxxaxxxxxxxxxx, Armador, Solteiro, xxxxxxxxxxxxxxxxxxe, documento de identidade xxxxxxxxxxxxx, Data de Emissão: 09/01/2001, residência: Relacionada Abaixo; tendo declarado o nascimento de STEFFANY LOPES ROSARIO,xxxxxxxxxxxxxx, às 01:47 horas, no xxxxxxxxxxxxxxxxxx, Praça XV-RJ, Rio de Janeiro-RJ, do sexo feminino, filho (a) do declarante e de xxxxxxxxxxxxxxxx (s) por ocasião do parto, profissão: Do Lar, documento de identidade xxxxxxxxxxx – SSPBA, Data de Emissão: xxxxxxxxxxxxx, residente na Rua Treze, n 18, Rio de Janeiro – RJ. Avós paternos: xxxxxxxxxxxxxxxxxxxx. Avó materna: xxxxxxxxxxxxxxxxx. Dispensadas as testemunhas, na forma do artigo 529 da Consolidação Normativa da x

1 Like

If you’re looking for a match with an uppercase name, use this regular expression:


This searches for any string with an uppercase word followed by one or more spaces, followed by an uppercase middle name with one or more spaces afterword (the * makes this optional), followed by the last name in uppercase.

Thank you for your attention, Anthony. Unfortunately, it didn’t work. What’s probably happening?

Welcome to the community!

Check this:

Thank you, bcorrea. It worked flawless when it comes to the Test Text in “RegEx Builder”, but when I’m going to print the message, nothing happens =/Screenshot_2

you dont print using the Matches object, it is a collection, if you expect to always find one and only one person, then you can use Matches(0).Value

1 Like

It worked beautiful and flawless. Thank you! :slight_smile:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.