I am fairly new to regular expressions and the more and more I use them, the more I like them. I am working on a regular expression that must meet the following conditions:
- Must start with an Alpha character
- Out of the next three characters, at least one must be an Alpha character.
- Anything after the first four characters is an automatic match.
I currently have the following regex: ^[a-zA-Z](?=.*[a-zA-Z]).{1}.*$
The issue I am running into is that my positive lookahead (?=.*[a-zA-Z]).{1}
is not constrained to the next three characters following the alpha character.
I feel as if I am missing a concept here. What am I missing from this expression?
Thanks all.