/(<pre>|<code>|\[code])(.*)(</pre>|</code>|\[/code])/gi
This works if I have something such as:
<code>foobar</code>
But if I were to have a line-break like this:
<code>
Awesome
</code>
It will not match it, what am I doing wrong?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You do need the
DOTALLmodifer/s, because the.dot per default excludes linebreaks.The
/gmodifier OTOH is not legal in PHP and PCRE.You should also use
.*?to not match too wide.