I have to extract information from a web page. I am using get text , and I need to make a substring of the following text string (57 registered candidates), I need to extract the number “57” and save it in a variable. But that number could be 1 digit, 2 digits or 3 digits, so the substring must be able to capture the number regardless of its digits.
Hello. How could I do that, what you are showing from “Expression”.? Thank you so much
Try this:
inputString= "57 registered candidates"
extractedNumber= inputString.Substring(0, inputString.IndexOf(" "))
or
inputString= "57 registered candidates"
outputString= System.Text.RegularExpressions.Regex.Match(inputString,"\d+").Value
Hope it helps!!
After using GET TEXt and extracting the string
You can use this expression
Text.Substring(Text.IndexOf(“(”) + 1, Text.IndexOf(" registered candidates") - Text.IndexOf(“(”) - 1)
Hope this helps!!
Regards,
Gayathri M K
Hope you got the solution for your question @Julian_Torres_Torres
If yes please mark it as solution to close the topic.
After getting the string value from Get text activity
Use Find Matching Patterns activity give the input variable in Text to search in option in properties panel
Click on configure Regular Expression In RegEx column change to Advanced and In value column add the following :
/[0-9]+
click save
To store the output create a variable and assign it in Result option in properties panel
Use this code to get the exact value in string format
OutputMatches(0).value
where OutputMatches is the output from Find Matching Patterns activity








