omegastripes / VBA-JSON-parser

Backus-Naur Form JSON Parser based on RegEx for VBA
GNU General Public License v3.0
108 stars 44 forks source link

Escaped characters in a string #15

Closed personalityson closed 4 years ago

personalityson commented 4 years ago

Unicode characters of the form \u1234 and other escaped stuff like \n

This part of the string-matching pattern ""(?:\\""|[^""])*"" Should be something like ""(?:[^\\""]+|\\[""\\/bfnrt]|\\u[0-9a-fA-F]{4})*"" ie (non-escaped chars|\n|\u1234)* ?

https://www.crockford.com/mckeeman.html `string '"' characters '"'

characters "" character characters

character '0020' . '10FFFF' - '"' - '\' '\' escape

escape '"' '\' '/' 'b' 'f' 'n' 'r' 't' 'u' hex hex hex hex

hex digit 'A' . 'F' 'a' . 'f'`

omegastripes commented 4 years ago

@personalityson Thanks for the input! Could you please share a JSON sample, which is parsed in wrong way, for testing, that would help a lot to fix the issue.

personalityson commented 4 years ago

Sorry, false alarm, this was just me, I messed up something in my code