in reply to Break down a regex expression into single regex?

Your pseudo-coded problem statement makes very little sense.

  1. read perldoc perlretut or any number of other documents re regexen.
  2. Change the capturing parens and perhaps add /g.
  3. Come back and show us what you've tried along with an explanation of how it fails, if that's the case