I'm a beginner in using Regex and have been struggling to create a pattern that can search for a single match of either ! or * anywhere in my string. The full requirements I am looking for are:
- Start with a letter
- Contain at least 1 number
- Between 8-16 characters
- Contain at least one ! or *
What I have so far is:
^[A-Za-z](!*)[A-Za-z0-9]{6,14}$
Clearly I'm using parenthesis incorrectly, but I'm still playing around with it and trying different things. What I am specifically struggling with is searching for a single instance of ! or * in any location.
If anyone can kindly provide a hint, it would be appreciated.