$f="chapter 1,2,3"; if($f=~m/chap( |[a-z])*([0-9|,0-9]+)/ i) { print "$f\n" ; #for split /,/,$2; } output needs : chapter 1,chapter 2,chapter 3 but does't work...