I need seperate regular expression to match the following:
All non special characters EXCEPT ' and - (match df&g but not ab-tg or df')
Any match from a list of strings e.g. "aka", "nee", "n/k" - either on their own or followed by a space (match "nee smith" or "aka jones" or "n/k" but not "Paneen" or "Pakah")
Two spaces in a row
Two hypens in a row
The "list of strings" is handled with an OR operation (using the Pipe symbol)
You can match all 'non special' characters with this:
I believe your requirement will be met with this:
The first will match 'McNe'e won't it? I don't want this, the string must be on it's own or followed by a space.
The second matches any no digit or non-space! I want to match any special characters EXCEPT ' and - such as [\\W^\\s^\\'^\\-] - this doesn't work!