Use http://rubular.com/ or https://jex.im/regulex/#!flags=&re=%5E(a%7Cb)*%3F%24 to test your regex.
#####Regex Basics
- [abc] A single character of: a, b, or c
- [^abc] Any single character except: a, b, or c
- [a-z] Any single character in the range a-z
- [a-zA-Z] Any single character in the range a-z or A-Z
- ^ Start of line
- $ End of line
- \A Start of string