What you tried is right, except you're missing the start and end characters, so it's succeeding on a partial match.
You need:
^[1-5][a-cA-C][x-zX-Z]?$
Question
I am new to regular expression. I need a regular expression to validate single digit within range of [1-5] followed by alphabet [A-C] and followed by optional alphabet [X-Z]
Solution
What you tried is right, except you're missing the start and end characters, so it's succeeding on a partial match.
You need:
^[1-5][a-cA-C][x-zX-Z]?$