in reply to Regexp string concat

Bit-wise oring is your friend. Although the answer comes out lower-cased :( - unless I change those pesky spaces to '@'s - which I just did.
my $string ="EICHENBAUMSCHULE"; my @query = qw(EIC BAUM UMS CHU LE); my $matchline = '@' x length $string; for $match(@query) { my $spacer = index $string, $match; $matchline |= (('@' x $spacer) . $match) if $spacer > -1; } print for sort { length($b) <=> length($a) } $matchline =~ /[^@]+/g;