Re: Regular Expressions
| From: | Jason Wong | Date: | Thu, 15 Jul 2004 13:50:50 +0000 |
| Subject: | Re: Regular Expressions | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-190588@lists.php.net to get a copy of this message | ||
On Thursday 15 July 2004 21:15, Arik Raffael Funke wrote:
>
> However if I have,
> Last Name:
> Street: Teststreet
> (no entry after last name)
>
> Both search strings return me:
> ----
>
> Street: Teststreet
> ----
>
> Also why doesn't "Last Name:\s*(.*)$" work, and neither "^Last
> Name:\s*(.*)". Both strings are not found at all - that's why I thought
> the php implementation might treat new lines in a strange way.
preg_match('|^Last Name:(.*)$|m', $haystack, $matches);
should work.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Someone is speaking well of you.
How unusual!
*/