I have searched on the internet but I don't get any solution. I just confused.
I have this string
("type": "Person" AND ("specialFields.email": "...
For further actions, you may consider blocking this person and/or reporting abuse
That looks like tokenisation, except It's strange that the key-value pairs are one token.
I'd more expect a result like
However if the grammar is really simple you might just get away with parsing it in one pass to
However, in any case, RegEx can only be used to parse small parts of this, if at all.
Especially, you must consider key and value strings that contain the characters
[](),:, the keyordsAND&OR, and escaped"\""(or however else double quote character is escaped in your query format)("\w+.?\w*":"\w+@?.?") This is working now.
How I can get the bracket and
ANDand `OR'?I wanted to use Stack to create a mongoose filter.
I am trying to create this output
It's working when I am using a string like this
I want to make the query simple from the user side.
("type": "Person" AND ("specialFields.email": "prathameshmore@gmail.com" OR "specialFields.address": "Jaysingpur"))
The stack is used to create this object
Use parser, for example pegjs.org/online