Skip to Content Skip to Menu

Negative regex in field validation

8 years 7 months ago #277244 by mikeprince
Negative regex in field validation was created by mikeprince
Does the regex allowed in field validation support inverse matching, or negative lookaround? I've been unable to get it to match any string except as given by the regex.

I'm actually trying to stop users registering and SHOUTING, i.e. entering names with too much uppercase, by detecting consecutive uppercase characters.

I've tried variants of the following without success:
Code:
^((?![A-Z][A-Z]).)*$ (?![A-Z]{2}/) (?!^.*[A-Z]{2,}.*$)

Any ideas why these are not working, or of a different solution to this?

Cheers
-- Mike --

Record, share and compare with BUBO Listing at www.bubo.org

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum