/(<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?
You do need the DOTALL
modifer /s
, because the .
dot per default excludes linebreaks.
The /g
modifier OTOH is not legal in PHP and PCRE.
You should also use .*?
to not match too wide.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With