ereg() problem
- From: jekillen@xxxxxxxxxxx (jekillen)
- Date: Tue, 30 Jan 2007 18:36:48 -0800
Hello php list;
I am having trouble with ereg().
The following is the problem code
$x = ereg("<route name='$to' x='../(.*)/in' rec='.*' />", $get_route, $m);
testing $route I get:
$route = $m[1];
print $route.'<br>';
jk/in' rec='a_378e6dc4.xml' /> (out put of print)
jk is all I am looking for but
is it greed that is missing the
forward slash and the single quote?
It seems like every time I do this I have to monkey around
with it until I get what I want. I have even changed the
formatting of files just so a regular expression would
work without this sort of trial and error.
Is there a way I can turn off greed in php's regex?
I am using php v5.1.2 with Apache 1.3.34
Thanks in advance.
JK
.
- Follow-Ups:
- Re: [PHP] ereg() problem
- From: Jim Lucas
- Re: [PHP] ereg() problem
- Prev by Date: Re: [PHP] Select record by ID
- Next by Date: RE: [PHP] What search algorithm does in_array() use?
- Previous by thread: Help wtih a query?
- Next by thread: Re: [PHP] ereg() problem
- Index(es):
Relevant Pages
|