user1447679
user1447679

Reputation: 3240

Regular Expression to limit consecutive capitalization

I need to validate an input so that no "individual" word within the textbox can contain more than 3 consecutive capital letters. The following doesn't seem to be working:

[A-Z]{3,}

This is a VB application.

Thank you very much.

Upvotes: 0

Views: 61

Answers (1)

alpha bravo
alpha bravo

Reputation: 7948

this pattern should do it ^(?!.*[A-Z]{4}).* a negative lookahead that does not see 4 consecutive upper case letters

Upvotes: 2

Related Questions