How to use regex "/(?:\$13\,371\ \-\ \$15\,054)/"?

Error i got is System.Linq.Enumerable+d__97`1[System.Text.RegularExpressions.Match]

Please correct the question details

1 Like

Im reading an pdf file and trying to extract curreny and for that this regex “/(?:$13,371\ -\ $15,054)/” works in other portal but not with uipath thats pdf file im using.
2017 Volkswagen Jetta 1.4T SE Sedan 4D Trade In Values _ Kelley Blue Book.pdf (238.7 KB)

:wink:

Use **For Each ** activity and then use the below condition in the in clause.

Regex.Matches(strText, "(?:\$13\,371\ \-\ \$15\,054)")

Then use the value inside the foreach as

matchy.value.tostring

If have to do in VB.net

For Each match As Match In Regex.Matches(data, "(?:\$13\,371\ \-\ \$15\,054)")
Magic(match.Value)
Next
2 Likes

i used assign acitivty
x = Regex.Matches(strText, “(?:$13,371\ -\ $15,054)”)
then used foreach item in x
but i’m getting error for this as


Regex is not declared and strText is not declared

buddy mention lke this in assign activity buddy

ck = System.Text.RegularExpressions.Regex.Matches…

and ck should of type
System.Collections.Generic.Ienumerable<System.Text.RegularExpressions.Regex.Matches>
buddy and you can search in browser type in variable panel under Variable Type column with that drop down option @apurvalost
That would work for sure try and let know buddy
Cheers @apurvalost

1 Like

(?:$13,371\ -\ $15,054) gives error of struct sytem.int32= 371


@Palaniyappan

@apurvalost
buddy pass them as string buddy within double quotes like this
Regex.Matches(strText, “(?:$13,371\ -\ $15,054)”)

1 Like


still geting this error cannot assign it to this variable

define the datatype of ck like this buddy @apurvalost
System.Text.RegularExpressions.MatchCollection

1 Like

nohelp

Hi @apurvalost,

Please check the attached xaml and let me know that does it satisfy your requirement.
FindCurrency.xaml (5.5 KB)

1 Like

missing activity

Buddy no system.colection.generic.ienumerable
only this buddy @apurvalost
for ck
define the datatype of ck like this buddy @apurvalost
System.Text.RegularExpressions.MatchCollection

1 Like

solved using

2 Likes

Amazing buddy
keep going
Cheers @apurvalost

1 Like

Just install UiPath.PDF.Activities package from manage packages and try.

1 Like

Those are already there , anyhow thanks for help its solved. Appreciated

1 Like

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