NYCPHP Meetup

NYPHP.org

[nycphp-talk] How can PHP extract a pattern from a string into another string?

David Mintz dmintz at panix.com
Thu Aug 7 12:36:34 EDT 2003


Have you had a look at
http://www.php.net/manual/en/function.preg-match.php ? Note example 3 in
particular.

On Thu, 7 Aug 2003, Phil Powell wrote:

> Once again I have to go with my native "language", TCL:
>
> regexp {^a=([^\n]+)\n$} $stuff {} myExtractedStuff
>
> How can PHP do the same thing? I want to extract a specific pattern match from a body into another variable.  What does that in PHP, the manual does not make it clear to me?
>
> Thanx
> Phil
>


---
David Mintz
http://davidmintz.org/
Email: See http://dmintzweb.com/whitelist.php first!

Decibels of sound pressure employed by a new "thermoacoustic" refrigerator: 190
Decibels of sound pressure sufficient to ignite a person's hair: 165

	-- Harper's Index, February 2003



More information about the talk mailing list