La funzione che uso in realtà è:

Codice PHP:
preg_match("/<tag>.+<\/tag>/i",$code,$tag); 
prima ho messo un backslash di meno...