fastjson could not parse regexp str

kdfy810k  于 4个月前  发布在  其他
关注(0)|答案(1)|浏览(53)
JSON.parse("[{pattern:/\d{11}/}]")

such as this , JSONException , invalid comment

wlzqhblo

wlzqhblo1#

"[{pattern:/\d{11}/}]" isn't a valid json format,the reason of JSONException is fastjson think '/' is the beginning of comment,but only the following comment formats are valid:

// comment
/* comment */

相关问题