Hello Team,
We have a text present in below format
Example:
Result List : 1 document found
Value to extract : 1
Hello Team,
We have a text present in below format
Example:
Result List : 1 document found
Value to extract : 1
Follow this:
\d+
you can try this way also
System.Text.RegularExpressions.Regex.Match(str,"[0-9]{1}").Value
Thanks @tazunnisa.badavide , @Praveen_Mudhiraj for the quick responses
Just one question @Praveen_Mudhiraj will it work even if there are 2 digit or 3 digit value ?
try like this
str = “yourText”
System.Text.RegularExpressions.Regex.Match(str,"[0-9]{1,}").Value
out put : -
HI @NISHITHA
@NISHITHA the regexx above will even word if there are more than one digit
Hi @NISHITHA
Input= "1 document found"
Output= System.Text.RegularExpressions.Regex.Match(Input,"\d+").Value
The above regex will extract if there are multiple numbers present at the same place.
Hope it helps!!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.