locutus
locutus copied to clipboard
Failure to recognize some format and extract values in sscanf
Hi. First of all thank you for your great job. I'm going to report some bug in sscanf function. sscanf can not recognize this formats and extract matched values. Tested at: Windows and ubnutu
Format 1: "%[^[]]" Test Case:
let dataScanned = sscanf('mobile[country_code]', '%[^[]]');
console.log(dataScanned);
JS sscanf output:
[]
PHP output:
Array
(
[0] => mobile
)
Format 2: "%[^[][%[^]]]" Test Case:
let dataScanned = sscanf("alphanumericWithCustomChars[en,fa|-|_|)|(]", "%[^[][%[^]]]");
console.log(dataScanned);
JS sscanf output:
[]
PHP output:
Array
(
[0] => alphanumericWithCustomChars
[1] => en,fa|-|_|)|(
)