I am trying to get the matched value of a regex match, not the rest of the search value. If the user enters a field for a URL that has http://server.com or https://server.com, I want to put one of these in a variable. When I try to run the following code, the variable URLPrefix contains the entire URL. I only want to have the http:// or https:// in this variable. I have tried using \2 for the substitution, but that gives me everything else except the searched for strings.
My code is:
How do I get just the searched for item in the variable?
Please sign in to leave a comment.