Pattern "(*)(%[0-9a-fA-F]#2)*" [message #1817051] |
Thu, 14 November 2019 17:24 |
Olaf Bergengruen Messages: 127 Registered: November 2018 |
Senior Member |
|
|
Hi Titan-Experts,
The TTCN function below works correctly but produces hundred of strange log lines, all the same:
/*
* @desc restore URL-encoded (or "percent-encoded") URL:
* replace all "%XY" with the the respective character corresponding to the hex code XY
* @param p_EncodedUrl
* @return charstring
* @status APPROVED (IMS)
*/
function f_URL_Decoding(charstring p_EncodedUrl) return charstring
{
var charstring v_Url := p_EncodedUrl;
var charstring v_Pattern := "(*)(%[0-9a-fA-F]#2)*"; /* @sic R5s151006: * at the end sic@ */
var charstring v_PercentCodedChar;
var charstring v_HexCode;
var charstring v_Char;
var integer v_Pos;
while (true) {
v_PercentCodedChar := regexp(v_Url, v_Pattern, 1);
if (v_PercentCodedChar != "") {
v_Pos := lengthof(regexp(v_Url, v_Pattern, 0));
v_HexCode := substr(v_PercentCodedChar, 1, 2);
v_Char := oct2char(hex2oct(str2hex(v_HexCode)));
v_Url := replace(v_Url, v_Pos, 3, v_Char);
} else {
break;
}
}
return v_Url;
}
And the log file contains hundreds of lines like:
2019/Nov/14 00:21:01.410332 DEBUG IMS_CommonDefs.ttcn:160 regexp(): POSIX ERE equivalent of pattern "(*)(%[0-9a-fA-F]#2)*" is: "^(.*)(%[0-9A-Fa-f]{2}).*$"
What does this mean and how can I get rid of this irritating output? Again, the function works correctly.
Thanks for any hint,
Olaf @ ETSI STF160
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05024 seconds