Re: Regular Expressions (PCRE library)

From: Date: Sat, 03 Aug 2002 18:54:39 +0000
Subject: Re: Regular Expressions (PCRE library)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-110982@lists.php.net to get a copy of this message
On Sunday 04 August 2002 01:44, Jürgen wrote: > Anybody please tell me why the following is not working > > $test = "Hello, end why is not workin, END."; > > //before > echo $test . "<br>"; > > //Finds beginning of a line, followed by e or E, and replaces it with A. At > least it should do it, but it doesn't ? > $tes = preg_replace("/^[eE]/", "A", $test); This should work. However if you're using $test as defined above it does not start with 'e' or 'E' so what output did you expect?? -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Bershere's Formula for Failure: There are only two kinds of people who fail: those who listen to nobody... and those who listen to everybody. */

« previous php.general (#110982) next »