in reply to Re^3: Extracting the number of repetitions from a regex
in thread Extracting the number of repetitions from a regex

Code blocks in regexps are anonymous subs.
Wow - ikegami ...

It's all making sense to me now. Thanks for the enlightenment! If calling a code block in a regex is effectively the same as calling a subroutine then I understand why the scope of the my variable in my initial code snipped is not wide enough!

Your wisdom and taking the time to share it are much appreciated.

Cheers - Pat