use re 'Debug';
or even better use re 'debugcolor';
and watch the state machine matching.Very useful for debugging.
http://perldoc.perl.org/re.html#%27Debug%27-mode
Another great resource is:
http://search.cpan.org/dist/Regexp-Debugger/lib/Regexp/Debug...