yonatankra 1 Posted January 24, 2014 Report Share Posted January 24, 2014 I've been searching for something like that but couldn't find it.I have a text like:"Go to http://mydomain.com/blabla and see what I'm talking about"or"Go to http://www.mydomain.com.br/ and see what I'm talking about"I want to be able to replace the domain name with something. For instance, an <a> element:"<a href="http://mydomain.com/blabla?someParam=someValue">Some text</a>"I tried using reg exp replace, but it's not working for me.Any idea how to make this work? Quote Link to post Share on other sites
Bot-Factory 602 Posted January 24, 2014 Report Share Posted January 24, 2014 Hello. It depends a little bit on the type of URLs you have to support. If they also contain stuff like ?id=xa77t then my example will not work.But for a regular ULR wil text and numbers, it works. So hopefully it helps a little bit to get you started. set(#test, "Go to http://mydomain.com/blabla and see what I'm talking about", "Global")set(#test1, "Go to http://www.mydomain.com.br/ and see what I'm talking about", "Global")set(#test2, $replace regular expression(#test, , "\"<a href=\"http://mydomain.com/...Param=someValue\">Some text</a>\""), "Global")set(#test3, $replace regular expression(#test1, , "\"<a href=\"http://mydomain.com/...Param=someValue\">New text</a>\""), "Global") If you need support for other stuff, just add that into the [a-zA-Z0-9./]The important thing is to have a space after the URL. Because that's the separator. CheersDan Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.