Short answer: too many forward-slashes, not enough backslashes. PHP takes Perl-style regex literals, which use '/' as their (default) delimiter, and reproduces them inside PHP string literals. It also retains the Perl-style modifiers, meaning the 'i', 's', 'm', etc., following the closing delimiter. In Java, you drop the regex-specific delimiters, and replace the modifiers with symbolic constants like Pattern.CASE_INSENSITIVE, which are ...