I'd like to preface this with how little I know about RegEx
.
I'm trying to get the following RegEx to work with Javascript/Typescript:
/^({)?(?(1)|(\()?)[0-9A-F]{8}(-)?([0-9A-F]{4}(?(3)-)){3}[0-9A-F]{12}(?(1)}|(?(2)\)))$/i
This is RegEx for determining if a string is a valid GUID (in any of the correct forms; as seen here: https://stackoverflow.com/a/136591). It works for Python and PHP, but not for Javascript since it doesn't support conditionals. How would you write this in such a way that Javascript can use it?
You can test it here: https://regex101.com/r/rosi2k/1/tests