(?> … ) is the syntax for an atomic grouping. And the syntax for look-ahead assertion is just
(?! … ).
Edit Try this regular expression instead:
.*$ will consume everything and the look-behind assertion will exclude those that end with a
Edit Just for completeness’ sake: If your regular expression language does not allow look-behinds, you can also use this one using a look-ahead assertion:
Or using just alternations:
solved How to Regular Expression match not having a constant at the end of a string (.net validator)