RegEx word and numbers

Hello!
Which expression should I use? For example, I have:

134
sdefwe
fwarg 31
fwe4fwe
wetf23tfw4tg24
235
sergwgt 1351

I need to leave only lines where there are numbers separately:
134
fwarg 31
235
sergwgt 1351

And also I need clean received lines from words and leave:
134
31
235
1351

Getting rows with number separately:
[0-9 ]+

extracting numbers from lines:

\d+

How to combine it?

Hi,

Can you try Matches activity with the following settings.

Input : your string variable
Pattern : "(?<=(^|\s))\d+$"
RegexOption : check Multiline

Regards,

1 Like

@RPA3
@Yoichi
@ThomasStocker

Please find the workflow as per your requirement.

Kindly mark as solution if you found it useful.

Thanks and Regards,
hacky.

@RPA3_Solution.xaml (7.6 KB)

Test.xlsx (8.3 KB)

For numbers only : \b\d+\b
For lines containing these numbers: ^.*\b\d+\b.*$ with Multiline option

image

1 Like

@RPA3, you got solution ah?

Else Please refer the Regex Pattern given below
image