1

I'm getting an error into my React app that is killing me lol. I searched in every forum, every questions, every GitHub issue... Nothing solve my problem. In fact my react app is working on chrome, firefox, but not in safari and any iOS browser. It shows me a blank page. in the console I can see: SyntaxError: Invalid regular expression: invalid group specifier name so I tried to change my regex expression which is:

/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/

But nothing solve. In the inspector I can see "You need to enable JavaScript to run this app.". And I repeat I tried everything that I found in every other asks. Nothing solve it :/ please help me ! Thanks in advance !

xom9ikk
  • 2,159
  • 5
  • 20
  • 27
Tom large
  • 11
  • 1
  • The 'you need to enable javascript' is a default element in react so don't worry aboout that. Apple is special .. and not in a fun way. See even though safari is a chromium browser. The OS differs enough that even Chrome on Mac won't run the same functions it does on windows or android. I recommend you to look closer att your CSS. That has been my issue many, many, way too many times.. For example I had a problem with the 'perspective' property. It didn't show the elements affected by it.. Turns out Apple doesn't like if you add an `overflow:scroll` or `hidden`. While other OSeses worked fine. – zergski Dec 27 '20 at 03:41
  • It looks like you are trying to validate an IP address by range. the `.` likely needs to be escaped as `\.` to avoid false positives. On Safari and iOS issue, could be a difference in how non-participating groups are handled, see http://blog.stevenlevithan.com/archives/npcg-javascript – Peter Thoeny Dec 27 '20 at 07:21
  • nothing works :/ I've found this in my safari debugger: const variable = "segment.match(/(?<={)[$0-9a-zA-Z_]+(?==.*})/g) || [];" – Tom large Dec 27 '20 at 16:54
  • For me the issue was the use of the lookahead/lookbehind. i just broke it down into multiple steps instead of using 1 regex & that worked – Dave B. Dec 01 '22 at 03:07

0 Answers0