Your $code string seems to have newlines in it, and by default, . (dot) (update: in the .*? regex expression) does not match newlines. Try using the /s (dot matches all) regex modifier on your substitution.
Update: Please see Modifiers; s/// in Regexp Quote-Like Operators.
Give a man a fish: <%-{-{-{-<
In reply to Re: Really basic regex question!
by AnomalousMonk
in thread Really basic regex question!
by ultranerds
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |