Page 1 of 1

Help using EVAL to remove text

Posted: Mon Aug 22, 2016 6:59 pm
by xologist
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

Re: Help using EVAL to remove text

Posted: Tue Aug 23, 2016 6:36 am
by iimfun
You should try this

Code: Select all

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

Re: Help using EVAL to remove text

Posted: Tue Aug 23, 2016 3:14 pm
by xologist
iimfun wrote:You should try this

Code: Select all

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

Thank you!