peak_positions 2 Posted April 20, 2012 Report Share Posted April 20, 2012 Hi, I've set a variable to get content. Now i need to place the link where the keyword appears in the variable but only one time. For example... video is my keyword. in #content variable I have the following content. "Having said that, in case you cannot invest a lot time and effort in executing all this, the simplest way for you personally are going to be to get a video clip Seo pro support or use a professional YouTube video marketing and advertising firm." Now i would like to replace only one keyword either fist one or second one as "http://mysite.com/". I tried in lot of ways but i couldn't find it.... anybody have Solution??? Quote Link to post Share on other sites
Legend 181 Posted April 20, 2012 Report Share Posted April 20, 2012 Not sure what you're trying to do... are you trying to replace the keyword with link and anchor text? Something like this? set(#anchor link, "<a href=\"http://www.link.com/\">anchor text</a>", "Global")set(#replace keyword, $replace(#keyword, #keyword, #anchor link), "Global") Quote Link to post Share on other sites
peak_positions 2 Posted April 20, 2012 Author Report Share Posted April 20, 2012 Yeah ... exactly.... but it replacing all the keywords... i just want to replace only one keyword... Quote Link to post Share on other sites
Legend 181 Posted April 20, 2012 Report Share Posted April 20, 2012 Ah... there's a RegEx expression for replacing only the first occurrence of a variable... hopefully one of the RegEx guys has it... Quote Link to post Share on other sites
Pete 121 Posted April 20, 2012 Report Share Posted April 20, 2012 The problem is as I see it the regex global flag is set to true within ubot 4I spent quite some time trying to work around this but failedI could get it to work sometimes but it would not work within a loop 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.