you probably need to add the "s" modifier to regexp. Without the s, the dot does not match newlines.
remember, however, that regexp is the wrong tool for html parsing, better consider the dedicated parsing library available in your language.
source share