darkshark Posted February 2, 2011 Share Posted February 2, 2011 (edited) please, anyone help me? i trying this 2 hours and nothing x.x i need to transform this: http://www.mysite.com/default.asp?my-category in http://www.mysite.com/my-category/ i tryed this: StringRegExpReplace("http://www.mysite.com/default.asp?my-category" , "([^.?]+[^.?/])", "$1$2") and others, but... nothing x.x anyone help me please? thanks a lot! Edit: i tryed: StringRegExpReplace("http://www.mysite.com/default.asp?my-category", "(/default\.asp\??)", "/") and it works sorry for the post and thanks all =) Edited February 2, 2011 by darkshark Link to comment Share on other sites More sharing options...
jvanegmond Posted February 2, 2011 Share Posted February 2, 2011 $in = "http://www.mysite.com/default.asp?my-category" $expected = "http://www.mysite.com/my-category/" $real = UrlTransform($in) If $real = $expected Then ConsoleWrite("URL transform: Test succesful" & @CRLF) Else ConsoleWrite("! URL transform: Test failed. Expected: " & $expected & " got: " & $real & @CRLF) EndIf Func UrlTransform($url) Return StringReplace($url, "default.asp?", "") & "/" EndFunc Free unit test included. github.com/jvanegmond Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now