Need 516250 from the text

Input : Previewing 2000 out of 516250 items
Output : 516250

The configuration C# with windows-legacy

Thanks in advance

try this
System.text.regularExpressions.regex.match(items, "(?<=of)\s(\d+)").Groups(1).value

Can you try to modify as the following

System.Text.RegularExpressions.Regex.Match(Items,"(?<=of)\\s\\d+").Value

Or the following might be better if it’s unnecessary whitespace.

System.Text.RegularExpressions.Regex.Match(Items,"(?<=of\\s)\\d+").Value

Regards,

Hi @Pujari_Manjunatha

You can just use the find matching patterns activity

Select advanced and Pass the pattern

\d+

Then create a output variable and print it
image

matchResult(1).tostring

Regards!

Hi @Pujari_Manjunatha

For C# coniguration, you can try this:

{
    System.Text.RegularExpressions.Regex.Match(StrValue, @"\b\d+\b(?=\sitems)").ToString();
}

image

Hope this helps,
Best Regards.

Hi @Pujari_Manjunatha

Use the Regex expressions for the extraction of required output(516250)

Hope it helps!!

Hi @Pujari_Manjunatha

Please use the below regex expression

image

Hope it works !!

HI @Pujari_Manjunatha

If you are using Matches expression you need to give the index

try with providing index
YourExpression(0)

Regards
Sudharsan

Hello @Pujari_Manjunatha , Actually your expression is Good. But you are using the Matches Condition. Try with the Match condition

System.text.regularExpressions.regex.match(YourString, "(?<=of)\s\d+").Tostring.Trim

For Matches condition, try this

System.text.regularExpressions.regex.matches(YourString, "(?<=of)\s\d+")(0).Tostring.Trim

Hi @Pujari_Manjunatha

If your input is going to be in the same format always:

Then you can use the below, it would be the simplest one:
define a string type variable TotalItems.

TotalItems=inputText.Split({“of”},StringSplitOptions.None)(1).Split({“items”},StringSplitOptions.None)(0).Trim

Thanks

Try with this

System.Text.RegularExpressions.Regex.Match(Items,"(?<=of)\s\d+").Value

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