Re: Regular Expression Help

From: Date: Mon, 31 Dec 2001 16:38:26 +0000
Subject: Re: Regular Expression Help
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-79123@lists.php.net to get a copy of this message
* John Monfort (monfort@kahuna.sdsu.edu) [Dec 31. 2001 11:30]: > I'm using regular expression to extract all text within the <body> tag. > With a BODY tag like > <body bgcolor="" ... text=""> \\only interested in this line. [...] > echo "$out[0]"; > However, this prints everything following (and including) the '<BODY' > portion of the BODY tag. "$matches[0] will contain the text that matched the full pattern, $matches[1] will have the text that matched the first captured parenthesized subpattern" So you want: $out[1] -- Brian Clark | Avoiding the general public since 1805! Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8 Press Ctrl-Alt-Del for more information.

« previous php.general (#79123) next »