0

I know there are some answers that help converting negative lookbehind in regex for JS engines prior to ECMA 2018. However, I can't seem to use these hints against my specific regex.

One of these answers: javascript regex - look behind alternative?

Here is the original regex (it's my registrar's domain name acceptance regex) :

^((?!-)[-a-z0-9]{1,63}(?<!-)\.)+(?=.{1,63}$)(?!-)([-a-z0-9]*[a-z][-a-z0-9]*\.?)(?<!-)$

How should I use the combination of supported features in current JS (browsers as of early 2018) to achieve this behaviour?

Thank you.

Ninj
  • 1,492
  • 1
  • 15
  • 27
  • I'm pretty sure you made a mistake when copying your regex here. `(?!)` will discard any match. Can you describe what this regex is supposed to match and what bot? maybe add a couple of test cases? – Sebastian Proske Jun 28 '18 at 09:45
  • You're right, sorry, some IM programs interpret the hyphen and it disappeared... – Ninj Jun 28 '18 at 09:51
  • PS : I edited the regex, thank you :) – Ninj Jun 28 '18 at 14:24

0 Answers0