I am trying to write a regex test in JavaScript to check if a string solely contains balanced single braces, solely containing balanced double braces should return false.
For example:
if the string is "{something}", "abc{something}cbd", it should return true,
if the string is "{something}abc{{somethingElse}}", "{{somethingElse}}{something}", it should also return true,
however, if the string is "{{something}}" or "{{something}}abc{{somethingElse}}", it should return false
I have a regex solution for this, which is /(?<!{\s?){(?!\s?{)[^{}]+(?<!}\s?)}(?!\s?})/gm, however ios safari doesn't support negative lookbehind.