http://www.perlmonks.org?node_id=1030807


in reply to how to fetch 1,2,3, from chapter

$f="chapter 1,2,3"; if($f=~m/chap( |[a-z])*([,0-9]+)/i) { print join ", ", map { "chapter $_" } split /,/,$2; }