For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > August 2005 > Regular Expressions









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Regular Expressions
John

2005-08-05, 3:59 am

I am fairly new to php but I think I must be completely missing the
poiny here (or going mad)

I would have expected this to match, am I right?

if (eregi("a89", "a.[0-9]" ))
{echo "<br>match";}
else {echo "<br>no match";}

Thanks for any help

John

Kimmo Laine

2005-08-05, 3:59 am

In < news:2k56f1ta3pqfv2pnfbg0g8tr86ugkensme@
4ax.com>
John <asdvfasd@asdfvrfg> enlightened us thus:
> I am fairly new to php but I think I must be completely missing the
> poiny here (or going mad)
>
> I would have expected this to match, am I right?
>
> if (eregi("a89", "a.[0-9]" ))
> {echo "<br>match";}
> else {echo "<br>no match";}
>
> Thanks for any help
>
> John


You just got them parameters backwards. First the pattern, then the string
where to look for.

<?php
if (eregi("a.[0-9]","a89"))
echo "<br>match";
else
echo "<br>no match";
?>

--
Welcome to Usenet! Please leave tolerance, understanding
and intelligence at the door. They aren't welcome here.
eternal piste erection miuku gmail piste com


John

2005-08-05, 4:59 pm

On Fri, 05 Aug 2005 08:34:58 +0100, John <asdvfasd@asdfvrfg> wrote:

>I am fairly new to php but I think I must be completely missing the
>poiny here (or going mad)


What can I say apart from DOLT.

Well for a start, sorry for missing this and thanks for your patience.

Belive it or not I did RTFM. Many times and looked on various sites to
get a different view. I can only assume I had a blockage such that
when it said 'pattern' I read it as the pattern to be tested. Heyho.

All I have to do now is work out the test I need.

Thanks again, all comments much appreciated.

--
John


PS Sorry for posting seperately as well. Shan't do that again, after
this

meltedown

2005-08-05, 9:59 pm

Veikko Mäkinen wrote:
> John wrote:
>
>
>
> Please do not cross post (send a single message to multiple groups). If
> you want to send it to more than one group just send one message with
> all the groups listed in the header and set follow-ups to a single
> group. See http://home.icomnet.com/support/usenet.shtml
>
> I answered you in alt.php.
>
>
> -veikko
>

You misundertood what a crosspost is.
From the page you linked to:
"Cross-posting is posting a Usenet article to more than one newsgroup by
writing all the newsgroup names in the article's header."

So when you tell anyone to "just send one message with
all the groups listed in the header" you are telling them to crosspost.
Veikko Mäkinen

2005-08-06, 8:59 am

meltedown wrote:

> You misundertood what a crosspost is.


ups, I meant multipost :)


-veikko

--
veikko
mail@ .com
makinen
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com