Jump to content
UBot Underground

About replace function


Recommended Posts

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???

Link to post
Share on other sites

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")

Link to post
Share on other sites

Ah... there's a RegEx expression for replacing only the first occurrence of a variable... hopefully one of the RegEx guys has it...

Link to post
Share on other sites

The problem is as I see it the regex global flag is set to true within ubot 4

I spent quite some time trying to work around this but failed

I could get it to work sometimes but it would not work within a loop

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...