http://qs321.pair.com?node_id=625949


in reply to Backref in a regex quantifier

No, backreferences are not allowed there. It could be implemented, but I don't think it comes up often enough to be needed.

However, if I can simplify your example even further and assume that the first (\d+?) is always of fixed length (say 4 characters), then the following will give you what you want:

unpack("a4/A*", $_)