vganchev wrote: ↑Thu Jan 14, 2021 4:37 pm
Hi and thanks for your proposal.
I start thinking how to avoid using regex and find other way and it's working good.
SET !VAR2 EVAL("'{{!COL2}}'.replace("VIN:","")")
Hum, you don't need to quote your OP again, that doesn't really help for the Readability of the Thread...
OK, nice to hear that it works, and your "other way" is the same like my 'replace()' Solution, using some slightly different and simplified Syntax...
The Syntax I use is deliberately not simplified and is easy to use with iMacros and to reuse and to extend to much complexer and much longer Expressions, and also to debug Step by Step inside the 'EVAL()'... And it usually takes care "automatically" of Double Quotes and Special Chars without the Need to escape them...
I would have expected for example that you would have needed to escape the Double Quotes inside your 'replace()'... But OK, if it works, then that's "good enough", I would think...
As an Example, if you had needed to remove the double Quotes from your Input in 'Col_20', this could have been done like, and applied to the 'replace()' Solution as you seem to prefer this one, and also keeping the Space like you do...:
Code: Select all
SET VIN_Code EVAL("var c20='{{!COL20}}'; var x,y,z; x=c20.split('\"'); y=x[1]; z=y.replace('VIN:',''); z;")
PROMPT COL20:<SP>_{{!COL20}}_<BR>VIN_Code:<SP>_{{VIN_Code}}_
And this is just one of many-many different Solutions...
And if it was not working "directly", then you would be able to replace the final "z" by "x" and then "y" to debug the Expression and check what those Steps are doing...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...