cojs / co-body

Parse request bodies with co
MIT License
325 stars 42 forks source link

匹配JSON的正则不完整,建议更新 The regularity matching JSON is incomplete, it is recommended to update #82

Closed xinlingqudongX closed 1 year ago

xinlingqudongX commented 2 years ago

在json.js中匹配JSON的正则不能匹配所有

Regex matching JSON in json.js cannot match all

const strictJSONReg = /^[\x20\x09\x0a\x0d]*(\[|\{)/;

我现在用的正则为

The regex I am using now is

const jsonReg = /^\d+$|^".*"$|^\[.*\]$|^\{.*\}$|^true|^false$/;