You can use the following:
$regex = '#<s*?code[^>]*>(.*?)</code[^>]*>#s';
<codeS>
[^>]*
s
See the result here : http://lumadis.be/regex/test_regex.php?id=1081
2.1m questions
2.1m answers
60 comments
57.0k users