http://qs321.pair.com?node_id=998824


in reply to Unrecognized escape \Q passed through in regex

I had the same problem. I think

$window =~ eval 'qr{'.$regexp.'}' ;

should work, and not produce the error.