in reply to Regex Extended Comments with lookahead?
It has nothing to do with the lookahead, the problem is the /x is causing the spaces in your pattern to be ignored. So
"foo bar" =~ /foo bar/x; won't match, but "foo bar" =~ /foo\ bar/x; will. If you backslash your spaces (or use \s+ for more flexibility) it should work fine.