2

I've been banging my head against the wall for an hour or so now trying everything I can think of to get \p{L}+ to match a string in javascript. The below returns false every time and I don't know why. It works in my local regex tester and works on regex101.com but fails in situ.

var reg = /\d\d\ \p{L}+\ \d\d\d\d/;
return (reg.test('30 october 2014'));

I've googled a ton of things about this but all to no avail.

Thanks in advance

EDIT

The reason I've gone down this route as opposed to [a-zA-Z] is because I will need to match accented latin as well.

Drew
  • 3,154
  • 7
  • 39
  • 61

1 Answers1

3

JavaScript doesn't currently support Unicode regular expression categories. I suggest using XRegExp and its Unicode addon.

Tim Down
  • 306,503
  • 71
  • 443
  • 520