Reputation: 11
Looking for some help with a Regular Expression to do the following:
Thanks for any help, Dave
Upvotes: 1
Views: 106
Reputation: 386030
Solve this in two steps:
[a-zA-Z]+
which means "one or more of the letters from a-z or A-ZThere's no point in trying to cram these two tests into a single complex regular expression that you don't understand. A good rule of thumb with regular expressions is, if you have to ask someone how to do it, you should strive to use the least complex solution possible. If you don't understand the regular expression you won't be able to maintain the code over time.
In pseudocode:
if regexp_matches('[a-zA-Z]+', string) && string not in ['Default', 'Foobar', ...] {
print "it's a keeper!"
}
Upvotes: 0