I'm trying to resolve a situation where I need to see if current URL matches a stored URL, but only the characters after the last slash. Characters before that may vary, and if so, I still want it to return a match. I've worked out half of the problem in that if compares the end of the current URL to a string.
Code: Select all
SRT>matchEndURL
Let>targetString=matchEndURL_var_1
UIGetValue>windowName,{"Address and search bar"},currentURL,
Length>targetString,strLength
Position>targetString,currentURL,1,targetStringPos,TRUE
MidStr>currentURL,targetStringPos,strLength,truncURL
IF>truncURL=targetString
Let>matchEndURL_PF=PASS
ELSE
Let>matchEndURL_PF=FAIL
ENDIF
END>matchEndURL
GoSub>matchEndURL,targetString
So far, so good, but it assumes I already have targetString isolated (the string of characters after the last slash in the targetURL.) I don't have targetString yet. What I do have is the targetURL, and still need to find a way to parse targetString from targetURL despite the fact that the number of characters in targetString will vary, and the number of slashes in targetURL will vary.
So, basically, how do I start with targetURL, then extract all the characters after the last slash (targetString) so I can feed targetString into the above SRT?