But for correct treatment of strings, such as if "ty\"pe": "Pe\"rson" is allowed, you should look at using a proper tokenizer, for example moo: github.com/no-context/moo#states (see how they match string escape here!)
You can then take tokens from this tokenizer yourself, or give it to for example nearley: nearley.js.org/docs/tokenizers
I suggest you read the documentation for these two libraries later today when you have time, you will then be a head above most people in tasks where custom text formats need to be parsed.
What language are you using? Javascript?
Are you on the NodeJS runtime?
Can you use libraries from npm?
Yes, I am using JS and Node.js.
Yes, I can use lib from npm. Can you suggest to me?
I am a junior developer. Joined 1 month ago. You saved me.
Thanks, man.
Look output now
Filter is final output
Nah, you're good.
But for correct treatment of strings, such as if
"ty\"pe": "Pe\"rson"
is allowed, you should look at using a proper tokenizer, for examplemoo
: github.com/no-context/moo#states (see how they match string escape here!)You can then take tokens from this tokenizer yourself, or give it to for example
nearley
: nearley.js.org/docs/tokenizersI suggest you read the documentation for these two libraries later today when you have time, you will then be a head above most people in tasks where custom text formats need to be parsed.
Thanks Mihail for such valuable time.
How I can modify the Regex so can support for
>
,<
,<=
,>=
,=
and!=
.E.g.
This is working