carmen
February 26, 2020, 9:24pm
1
Hi Guys …
I have a string like this …
I just need the string between the tags, I am not sure if that tags will be always the same long so maybe I could do a substring …
Is any way to do it? The tag has a variable name always … the long seems to be the same …but not sure if always will be like that.
Hi @carmen
You can use the Match Activity https://docs.uipath.com/activities/docs/matches
In the pattern you can include the predefined tag that you have, you only need to add and .* to match all the characters after the tag.
Regards,
Andres
@AndresTarazona I don’t think we can see your String , If it contains HTML tags Take a Screenshot of it and Send
carmen
February 27, 2020, 4:33am
4
oh good point … I didnt notice xD
1 Like
GBK
(GBK)
February 27, 2020, 4:46am
5
@Carmen - you can try with String.SubString option -
Am assuming only one div will be available in the string strOut - below logic will return your expected value.
strOut.Substring(strOut.IndexOf(“>”)+1,strOut.IndexOf(“”)-strOut.IndexOf(“>”)-1).Trim
@carmen Check this Link :
Regular expression tester with syntax highlighting, explanation, cheat sheet for PHP/PCRE, Python, GO, JavaScript, Java, C#/.NET.
Try your other Sample Strings in it, If it gives the Output that you need, Then you can use Matches Activity and Retrieve all the Matched Strings
carmen
February 27, 2020, 5:13am
7
thanks, I was trying but that is not working …
carmen
February 27, 2020, 5:13am
8
that works perfect. Thanks
1 Like
system
(system)
Closed
March 1, 2020, 5:13am
9
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.