Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in RPA by (12.7k points)

I am trying to pull out a specific number from a text string using regex in UIPATH. The regex works in every case where there is not a colon in the text.

I am searching for the word EWO (with or without a :). i.e. EWO or EWO: I then require the 6 numbers which come after this word.

I have used the following up until I discovered there could be a colon: Text to search

TEST0203033 EWO 125399 WWT US QUOTE# 1235338.1

or

TEST0203033 EWO: 125399 WWT US QUOTE# 1235338.1

I have tried adding a :? to make the colon in the search optional, but get strange responses back.

In the String TEST0203033 EWO: 125399 WWT US QUOTE# 1235338.1

using

(?<=EWO:?\s*)([0-9]+)

results : 12

Where I was expecting the result 125399

Original, does not work with colon

(?<=EWO\s*)([0-9]+)

Produces some weird results

(?<=EWO:?\s*)([0-9]+)

1 Answer

0 votes
by (29.5k points)

hi try using the following regex it should work :

((?<=EWO\s)[0-9]+|(?<=EWO:\s)[0-9]+)

Related questions

0 votes
1 answer
asked Jul 22, 2019 in RPA by noah kapoor (5.3k points)
0 votes
1 answer
asked Jul 10, 2019 in RPA by Abhishek_31 (12.7k points)
0 votes
1 answer
0 votes
1 answer
asked Jul 10, 2019 in RPA by Abhishek_31 (12.7k points)

Browse Categories

...