0

Here's a link to a regex. I want to do something like:

if STATE is FIXED:
   do a
else:
   do b

with the regex and I wrote a regex

(?(?=.*?"state":"FIXED")"a":"(.*?)"|"b":"(.*?)")

It is working with php but not with javascript regex engine. Giving the following error.

? The preceding token is not quantifiable

I want to know why this is happening and what will be the correct regex for javascript engine.

Pratik
  • 1,351
  • 1
  • 20
  • 37

0 Answers0