Answer the question
In order to leave comments, you need to log in
How to insert regex into json?
I have a regular expression like this: /\(?([0-9]{3})\)?([ .-]?)([0-9]{3})\2([0-9]{ 4})/
but in general it can be anything,
I need to send it in json format,
I went to this site: https://www.freeformatter.com/json-escape.html#ad-...
and formatted regex there to json and got this: \/\\(?([0-9]{3})\\)?([ .-]?)([0-9]{3})\\2([0- 9]{4})\/
it is passed but doesn't work because it has two characters in a row \\
is it possible to pass regex to json normally somehow?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question