locutus icon indicating copy to clipboard operation
locutus copied to clipboard

Failure to recognize some format and extract values in sscanf

Open mortezafs opened this issue 4 years ago • 0 comments

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|-|_|)|(
)

mortezafs avatar Jan 31 '21 14:01 mortezafs