[ic] RegEx Comparison

mihai at airdelights.com mihai at airdelights.com
Fri Oct 9 13:39:15 UTC 2020


Hello,

The following piece of code is supposed to compare the response message from an HTTP GET request to a value obtained from the previous webpage, using the CGI tag.

     'res_msg' : variable which holds the response message
     'order' : variable which holds the order number from the previous page

[if scratch res_msg =~ /[cgi order]/]
     [warnings message="Tracking email for [cgi order] successfully resent"]
[/if]

If all goes well, the 'res_msg' will contain the order number. However, I cannot get the regex comparison to return true in the if statement. I have tried manually inputting the order number as follows...

[if scratch res_msg =~ /{actual order number}/]
     [warnings message="Tracking email for [cgi order] successfully resent"]
[/if]

...which worked fine, meaning that the 'res_msg' variable is working fine. I can also see that the 'order' variable contains the order number since I am printing it in the warning message.

My question is, does the CGI tag do something funky to the text to where I cannot compare it in that manner? How would I go about extracting the order number from [cgi order] to be able to check it against 'res_msg'?

Any help or advice is greatly appreciated. Thank you.

Best,
Mihai Dan
Air Delights
mihai at airdelights.com



More information about the interchange-users mailing list