Re: Help with Preg match all (newbie) I think I got it
| From: | Michael Kelley | Date: | Tue, 15 May 2001 15:19:31 +0000 |
| Subject: | Re: Help with Preg match all (newbie) I think I got it | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-7581@lists.php.net to get a copy of this message | ||
Okay a little known fact that I left out ... each of the names has a \n attached to it after the first name. after reading more I found out about the m pattern modifier.
my pcre now looks like
preg_match_all( "/^$searchstr.*/im", $text, $array)
This seems to have gotten it.
Thanks anyway
Michael Kelley wrote:
Hello all, I'm trying to do a name search from a string containing full names. the format of the names is "Lastname, FirstName" the preg expression I'm using is preg_match_all( "/\b$searchstr.*.,.*/i", $text, $array) This works great if you don't type in the full last name i.e. kelle will return my entry but kelley returns nothing. Anyone out there that can help? I'd greatly appreciate it. Well I'm off to read more documentation and see if I can dig it out.-- Michael Kelley mkelley@nmsu.edu Programmer/Systems Analyst I New Mexico State University Information and Communication Technologies Work # (505)-646-1374 P.O. Box 30001 MSC: 3AT Las Cruces, NM 88003