in reply to RegExp madness

In order to match the regexp, Perl construct a special kind of construct called an finite automata (I don't know enough about the innards to tell if it's a deterministic or a nondeterministic one, but it doesn't really matter).

In order to construct it, it needs to know some things. A zero-or-more repeats is simple to construct, as is one-or more (they take very few nodes). X-repeats (where X is a known number) involve creating more nodes (on the order of X). But you have to know how many, or you can't construct the automata. And that's why it doesn't work..

As for your second question, you would simply replace (\d) with (\d\d) - there is no reason why \1 needs to be just one character...