I am trying to use Regex to validate a users input on a project I'm working on. The pattern I'm currently using is
^[1-9][0-3]?|[Q|q]$ //Range of 1-13 or Q|q (Can't include 0)
And according to Regex101.com it shows that a users input, say 15, is not a match, yet when I run the project it acts as if it is a match. How do I go about limiting this regex to only accept a range of numbers from 1-13 and the character Q or q? For context just in the event my while loop is wrong here is that code as well.
while (!match.Success)
{
// Ommited Console.WriteLines to for clarity.
FancyArtBottom();
Console.SetCursorPosition(47, 19);
userSelection = Console.ReadLine();
match = Regex.Match(userSelection, @"^[1-9][0-3]?|[Q|q]$");
}