Re: ereg problem?
| From: | sven | Date: | Fri, 25 Jul 2003 09:35:18 +0000 |
| Subject: | Re: ereg problem? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-156814@lists.php.net to get a copy of this message | ||
by the way, it's to complicated. the brackets [ and ] are used for
cha-groups. you can leave them for only one char. so this would be the same:
"\\n" (you have to escape the backslash with a backslash)
Curt Zirzow wrote:
> * Thus wrote John W. Holmes (holmes072000@charter.net):
>> chenqi1@zte.com.cn wrote:
>>
>>> who can tell me what's the pattern string mean.
>>> if(ereg("[\\][n]",$username))
>>> {
>>> /*Do err*/
>>> }
>>
>> It's looking for a \ character or a \ character followed by the
>> letter n anywhere within the string $username.
>>
>
> I hope that isn't looking for a Carriage Return, cause it never
> will...
>
> Just in case it is.... strstr($username, "\n");
>
> Curt