I'm using javascript and I'm trying to write a regular expression that matches anything except left and right parenthesis and anything between them. After doing a little research, I came up with a similar example here on Stackoverflow. In this particular example the following regular expression was used to match any three digit except 999.
[(?!999)(\d{3})][1]
This regular expression work as intended and matches 555 or 444 or 333 but not 999.
I want my regular expression to match as follow:
John Smith => John Smith
John Smith (RET) => John Smith
Mr. John Smith's (RET) (1st) => Mr. John Smith's
John William Smith (RET) => John William Smith
John => John
This is what I have so far, but it's not working:
(?!\([A-Za-z]?\))(.*)
Can someone tell me where I've gone wrong.