I'm trying to match a string with the following:
- starts with
[A-Z] - contains
[a-zA-Z- '\u00E0-\u00EF](Latin-1 Supplement - Match Unicode Block Range) - any other character is forbidden
- does not end with
[- ']or have[- ']next to one another. - has at least
2characters
I've been trying the following:
new RegExp(/^[A-Z](?!.*[- ']$).*[a-zA-Z- '\u00E0-\u00EF]$/);
My problem isn't that I'm not able to understand what regular expressions do, but whether they are correct. It's very easy (or not) to write a regex that looks like it should work but misses on a few things.
Any help would be much appreciated.
Edit
Valid string : Marie-Noëlle Tranchant, Jean-François Copé...
'space''space',--or''.