Question regarding extracting a portion of a string

Hi

There are two ways to do this

  1. Let us consider with what you have done already

You can use ur current method itself where just use the above expression alone like this in assign activity

str_title = System.Text.RegularExpressions.Regex.Match(outputWindow.Selector.ToString.Trim, “(?<=title=\W).*(?=\W\s)”).ToString.Trim

As simple as that

  1. Another method, a First and most simple thing is with GET ATTRIBUTE activity
  • have the use application/ browser activity and indicate on the application
  • then get the output from that activity named as out_element
  • now use a GET ATTRIBUTE ACTIVITY inside that use application/browser activity and pass the UiElement variable as input to INPUT ELEMENT Property
  • mention attribute as Title - the one you want and get the output as a string variable named str_title

Though you have mentioned as Title you need only the text between quotes and not completely
So use a Regex like this

In Assign activity

str_title = System.Text.RegularExpressions.Regex.Match(str_title.ToString.Trim, “(?<=title=\W).*(?=\W\s)”).ToString.Trim

Cheers @Clintonnn

1 Like