Help using EVAL to remove text

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

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
xologist
Posts: 6
Joined: Mon Aug 15, 2016 9:36 pm

Help using EVAL to remove text

Post by xologist » Mon Aug 22, 2016 6:59 pm

I am using EVAL to remove the word [EXTRACT], but it is leaving this []
How can I get rid of it all [EXTRACT] or EXTRACT and []

Here is my code:

Code: Select all

SET !VAR2 EVAL("'{{!EXTRACT}}'.replace(/(EXTRACT|#EANF#)/g, '');")

TAG POS=1 TYPE=TEXTAREA FORM=NAME:form1 ATTR=NAME:gwt_verifytag CONTENT={{!VAR2}}
I have also tried

Code: Select all

SET !VAR2 EVAL("'{{!EXTRACT}}'.replace(/([EXTRACT]|#EANF#)/g, '');")

TAG POS=1 TYPE=TEXTAREA FORM=NAME:form1 ATTR=NAME:gwt_verifytag CONTENT={{!VAR2}}
But it never gets rid of []

Help
iimfun
Posts: 239
Joined: Tue Jul 19, 2016 1:06 pm

Re: Help using EVAL to remove text

Post by iimfun » Tue Aug 23, 2016 6:36 am

You should try this

Code: Select all

SET !VAR2 EVAL("'{{!EXTRACT}}'.replace(/(\\[EXTRACT\\]|#EANF#)/g, '');")
xologist
Posts: 6
Joined: Mon Aug 15, 2016 9:36 pm

Re: Help using EVAL to remove text

Post by xologist » Tue Aug 23, 2016 3:14 pm

iimfun wrote:You should try this

Code: Select all

SET !VAR2 EVAL("'{{!EXTRACT}}'.replace(/(\\[EXTRACT\\]|#EANF#)/g, '');")
That worked perfectly!

Thank you!
Post Reply