in reply to Unrecognized escape \Q passed through in regex
\Q and \E don't work inside interpolations. They only work in regexp literals (m/here/, s/here// and qr/here/). Solutions:
and# Text. $text = 'Renata'; $window =~ /\b\Q$text\E\b/ism
and# Uncompiled regexp. $text = 'Renata'; $regexp = '\\b' . quotemeta($text) . '\\b'; $window =~ /$regexp/ism
# Compiled regexp. $regexp = qr/\b\QRenata\E\b/ism; $window =~ $regexp
The s modifier is useless if you don't use ".".
The m modifier is useless if you don't use "^" or "$".