while ( $string =~ /(a\w+)/g ) { print "$1\n"; } __END__ ar az