Find and Replace text?

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
sebi99
Posts: 2
Joined: Wed Apr 06, 2016 2:43 pm

Find and Replace text?

Post by sebi99 » Wed Apr 06, 2016 6:21 pm

I have page code

Code: Select all

<textarea rows="4" cols="50" id="rteDiv_rte">
<span>sample text <img src="http://www.site.pl/img/photo.jpg"></span>
</textarea >
how to change the text in textarea http://www.site.pl/img/photo.jpg >>> http://www.site1000.pl/img/photo1000.jpg
?
Trax
Posts: 43
Joined: Thu Sep 13, 2012 4:07 pm
Contact:

Re: Find and Replace text?

Post by Trax » Fri Apr 08, 2016 10:03 am

You could try js/regex

Code: Select all

var url = 'your url'

url.replace(/photo/gi, 'photo1000')
sebi99
Posts: 2
Joined: Wed Apr 06, 2016 2:43 pm

Re: Find and Replace text?

Post by sebi99 » Sat Apr 09, 2016 8:42 am

Trax wrote:You could try js/regex

Code: Select all

var url = 'your url'

url.replace(/photo/gi, 'photo1000')

Code: Select all

VERSION BUILD=8961227 RECORDER=FX
TAB T=1
URL GOTO=http://site.edit.com/ReviseListing&reviselisting=&js=1&itemid=2232324422
var url = 'http://www.site.com/img/'
url.replace(/http://www.site.com/img//gi, 'http://www.site.com/img/new/')
TAG POS=1 TYPE=BUTTON FORM=NAME:selling ATTR=ID:aidZ1
TAG POS=1 TYPE=BUTTON FORM=NAME:selling ATTR=ID:aidZ18
what is wrong? In imacros error: unknown command: VAR, line 4 (Error code: -910)
Trax
Posts: 43
Joined: Thu Sep 13, 2012 4:07 pm
Contact:

Re: Find and Replace text?

Post by Trax » Sat Apr 09, 2016 4:47 pm

You need to use javascript code should find plenty examples around...
Post Reply