Re: a little with preg_match
On Apr 27, 12:38am, nintesa <nint...@nomaaaaail.it> wrote:
> Hello... I'm trying to write a regular expression to match the content
> of a html tag.
>
> I need to match the content of <h1> i.e.
>
> <h1>Hello World</h1>
> <h1 class="red_background">Hello World</h1>
> <h1><img src="red.gif"/></h1>
>
> etc...
>
> can anyone me?
>
> Thanks!!
$pattern = "/<h1.*?>(.*)<\/h1>/";
test it.
|