I'm weak in my understanding of regex, and I've read all sorts of docs on the web this week and I still can't do this: I'd like to match a single digit, and a specific one at that. I can get $number =~ /^\d{1}$/ to differentiate between 3, 33, 333, etc. and limit to just one character. So now I want to match the digit itself and the following hasn't worked for me (to match the number 1, for example):
/^\d[1]{1}$/ /^(\d[1]{1})$/ /^\d([1]{1})$/
In reply to REGEX Match Single Digit by spickles
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |