use strict; use warnings; my $a = "bla bla and table.column like 'inhalt' and bla bla bla"; my $b = "bla bla and table.column like 'in''ha''lt' and bla bla bla"; my @a = $a =~ /^(.*?)([\w.]*) like ('.*')(.*)$/; print join("\n", @a), "\n"; print "-------------------------------------------\n"; my @b = $b =~ /^(.*?)([\w.]*) like ('.*')(.*)$/; print join("\n", @b), "\n";