|
Posted by venkatesh.naughty on March 20, 2008, 2:18 am
Please log in for more thread options > Venkatesh can....can... wrote:
> > $var=3D"{' venkat'}->->";
> > i want to get the "yes" token;
> > if i use
> > $var=3D~/\{'( .* )\}$/
> > i get venkat'}->->{'yes
>
> No you don't. You get nothing, because that regex does not match.
> However, with the /x modifier it matches and assigns the string you
> mention to $1.
>
> > how to get the "yes" token...
>
> One way:
>
> =A0 =A0 =A0$var =3D~ /.+$/;
>
> --
> Gunnar Hjalmarsson
> Email:http://www.gunnar.cc/cgi-bin/contact.pl
@gunnar
thanks it works but how?
the first .+ is greedy know? it 'll match up to the end right?
|