Regex text output

I am trying to just extract the numbers within the brackets in this text. Any help would be great. Also if someone can help me convert the output of the match activity to a string that would be very helpful.
image

Hi @UiUser

I don’t know regex, but as far as the match activity, you can use variable.ToString

Hope this helps!

1 Like

Hello @UiUser,
Try this regex. \[.*

Given that its a single match, you can get the result using `variable(0)’.

1 Like

This Regular expression will work
(?<=[).*(?=])

Please try it and let me know @UiUser

Annotation%202019-07-17%20160043

4 Likes

@pratyusha_gandham thank you the matching works however when im outputting the matches it is giving me an error when i enter a string variable to the “results” field of matches because it is an IEnumerable not a string…how would i get the result of an IEnumerable to individual strings?
image

Hello @UiUser
You cannot assign an string Variable as an output of matches activity as you are getting a collection of data.So it cannot be stored inside a string variable
If you want you can Individually store it inside a string variable based on its Position
So for instance if you want to get 9.0 you can assign String.Join(",",MatchesOutput)
here all values will be seperated with comma as a delimiter and than split that variable with Comma(,) and assign a variable with its position for 9.0 it’ll be YourStringVariable.Split(CChar(","))(0)
Check this workflow for better understanding
ExcelRegex.xaml (6.2 KB)

1 Like