0

I am trying to create a regex class from this pattern like this:

let regex:RegExp = RegExp(/^(?:[\x{c0}-\x{1ff}a-zA-Z\'-]){2,}(?:\s[\x{c0}-\x{1ff}a-zA-Z\',.-]{2,})+$/, 'iu');

I took it from an earlier project I did with PHP and I know it works there. However, it does not work here:

SyntaxError: Invalid regular expression: /^(?:[\x{c0}-\x{1ff}a-zA-Z\'-]){2,}(?:\s[\x{c0}-\x{1ff}a-zA-Z\',.-]{2,})+$/: Range out of order in character class

My environment runs on nodejs 6.

Can anyone help me fix this? thanks.

maranovot
  • 405
  • 1
  • 6
  • 17

0 Answers0