Hi, can somebody help me extract the string between 2 characters?
I need a string between “" and “(” or "” depends witch comes first.
ex.
a) “asglas_1234567_” = 1234567
b) “asglas_1234567(” = 1234567
Hi, can somebody help me extract the string between 2 characters?
I need a string between “" and “(” or "” depends witch comes first.
ex.
a) “asglas_1234567_” = 1234567
b) “asglas_1234567(” = 1234567
Hi you can use regex to extract the desired output from string
use matches activity
properties panel
and enter regex pattern in matches activity: \d*
You will get your output and then convert that to string
Thank you
Hello @tomaz
You can use the regex method
YourString= “asglas_1234567_” = 1234567
System.Text.RegularExpressions.regex.Match(YourString,"\d+").toString.Trim
Yes, but this is only a exemple, the correct string vill not be only numbers.
Hi @tomaz,
Check out this regex : System.Text.RegularExpressions.Regex.Match(test,“\w+(”).ToString.Replace(“_”,“”).Replace(“(”,“”)
Thanks & Regards,
Dibyaprakash
You can mark this as solution if your issue was resolved.
@tomaz ,
The above Statement and the example provided creates a bit of confusion as to what is really required ?
Do you want the String between the Double Quotes and Brackets or Just the number between them ?
More samples would help us strict the conditions and therefore build a concrete logic for the problem.
HI @tomaz
System.Text.RegularExpressions.Regex.Match(YourString,"(?<=asglas_)\d+(?=_|\()").Tostring
Regards
gokul
try this
System.Text.RegularExpressions.Regex.Match(YourString,"(?<=\Wasglas\w).*(?=_\W)|(?<=\Wasglas\w).*(?=\W\W)").Tostring
Hi @tomaz
Instead of \d+
use \S+
System.Text.RegularExpressions.Regex.Match(YourString,"(?<=asglas_)\S+(?=_|\()").Tostring
Regards
Gokul
You can also try this :
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.