Extarct string

I have a sentence
Input
When are you going to book the show,Show id-1661718_4567£

Output
1661718_4567

Output should be the value between show id - and £

@Demo_User

system.text.regularexpression.regex.match(inputstr,“(?<=id-).*(?=£)”).value

or

system.text.regularexpression.regex.match(inputstr,“(?<=id-)[0-9_]+”).value

HI @Demo_User

Check out this Regular exptression

System.Text.RegularExpressions.Regex.Match(YourString,"(?<=id\W).*(?=£)").Tostring

image

You can try this way

[0-9_]+

output: -

@Demo_User

Hi @Demo_User

Input= "When are you going to book the show,Show id-1661718_4567£"
Output= System.Text.RegularExpressions.Regex.Match(Input,"\d+\_\d+").Value

Hope it helps!!

Hi @Demo_User

Try this

System.Text.RegularExpression.Regex.Match(Input,“(?<=id-).*(?=£)”).value

image

Hope this helps!!

try this regex expression

str_Input = When are you going to book the show,Show id-1661718_4567£

System.Text.RegularExpressions.Regex.Match(str_Input,"[0-9_]+").Value.Trim

@Demo_User

hi,@Demo_User

System.Text.RegularExpressions.Regex.Match(Input,“\b[0-9_].*\b”).Value

Hi @Demo_User

You can use the below regular expression to extract the required output.

- Assign -> Input = "When are you going to book the show, Show id-1661718_4567£"
- Assign -> Output = System.Text.RegularExpressions.Regex.Matches(Input.ToString,"([0-9_0-9]+)")

Hope it helps!!

@Demo_User u can follow this regex pattern :(?<=id-)[0-9_]+
image

System.Text.RegularExpressions.Regex.Matches(Input.ToString,“(?<=id-)[0-9_]+”)

Regards,

Hi,

you can use below expression

inputText.Substring(inputText.IndexOf(“Show id-”) + “Show id-”.Length, inputText.IndexOf(“£”) - inputText.IndexOf(“Show id-”) - “Show id-”.Length).Trim