How Do You Comment Out the */ Part of a Regular Expression in PHP
问题 I have preg_replace function that I'm calling and putting on multiple lines for readability but the */ characters in the regex mess up the comments. How can I comment out all these lines without moving them all onto one line? return preg_replace('/.*/', 'Lorem Ipsum' . 'More Lorem Ipsum' , $foo); 回答1: You could use a different regex pattern delimiter character: return preg_replace('#.*#', 'Lorem Ipsum' . 'More Lorem Ipsum' , $foo); EDIT: The delimiter character is a feature of PCRE (Perl