/^\d\d$/ will also allow a trailing newline.
/^\d\d\z/ checks if the string contains exactly two digits and nothing else
Yes, there are other ways, but they are more complicated.
In reply to Re^2: Is there any other way to avoid greedy matching
by ikegami
in thread Is there any other way to avoid greedy matching
by krissmercedes
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |