Get text from a string sentence

Hi Guys,

I have a sentence " Welcome to the application JIRA, please contact us for setup".

I want to extract the JIRA from the sentence and assign it to variable “application_name”. Please suggest.

thanks

@vikrantyadav
You can use the Substring Method or Regular Expression. It really depends on how dynamic is this sentence.

1 Like

Hi Michael,
thanks for the suggestion.
But i need a word written after application and before " , "

thanks

Use Regular Expression either using the Assign activity or Matches activity.
Expression is “(?<=application.)(.*)(?=,)”

@vikrantyadav

Check as below

Hope this helps you

Follow Link

Thanks

2 Likes

Regex is not giving the correct output. it’s showing this is output not an application name.
System.Linq.Enumerable+d__97`1[System.Text.RegularExpressions.Match]

@vikrantyadav

The output of the Regex Matches is a Collection

So if you want to get the result then use Variable(0).ToString to access the first value

Hope this helps you

Thanks

1 Like

It’s giving output this :- JIRA, please contact us for setup.
not only JIRA.

@vikrantyadav

Check as below

Hope this helps you

Follow Link

Thanks

It’s fixed now. Thanks Mate.

1 Like

If we have . instead of ,
in this case do i need to use this code :- “(?<=application.)(.*)(?=.)” ?

That’s right! You can test your regular expression code script in here.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.