Reputation: 2603
I have a following JSON string:
{
"my_regex": "(?<somevalue>^(\S*\s*\S*)*$)"
}
When I try to validate the format using online tools like jsonlint, I get following error:
Error: Parse error on line 2:
..."object_condition": "(?^(\S*
-----------------------^
Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got >'undefined'
So my question is, what should I do to make it a valid JSON?
Upvotes: 1
Views: 140
Reputation: 1677
You need to escape the \
's:
{
"my_regex": "(?<somevalue>^(\\S*\\s*\\S*)*$)"
}
jsonlint :
Upvotes: 2