Regex not woring

Hi There,

I have this string:

SUBTOTAL 553,98

I need to apply the following regex:

(SUBTOTAL)\s\s*([^\n\r]*)

But when I try to text using the following variable

RegExMatches(0).Groups(2).Value

I obtain a null value in output.

Can anyone help me please ?

Thanks a lot.

@duiliopaolini - what exactly you are trying to extract from your string?

Are you trying to print 553,98??

image

@duiliopaolini - Here you go.

Yourvariable(0).Groups(2).tostring - This is the code you have to use to print 553,98.

image

Output:

image

Please mark this as solution, if it solves your query.

1 Like

Hey, your regex is actually working!
I highly encourage you to use Matches activity with RegEx in UiPath, not .Net methods
See details in the attachment

Btw, \s\s* can be shortened to \s+

regex.xaml (5.3 KB)

1 Like

Hey @duiliopaolini

Check out my Regex Megapost if you want to refresh your Regex skills more.

Regex help tutorial MEGAPOST – Making your first Regex post, Reusable Regex Patterns, Regex Troubleshooting, Sample Workflow and more

1 Like

@Yurii_Horobets - I don’t see see any .net methods used here…

If you see my screen shot, i have renamed my matches activity to “Extract Multiple Words”

@prasath17
Yes, exactly.

My post was related to the initial question. I just assumed, that author had might use them (in the Assign activity). I certainly may be wrong with that assumption :grinning:

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