Re: [PHP] Regular Expressions (PCRE library)

2002-08-03 Thread Jürgen

No im not saying that, im merely saying that in my given example even if i
turn the Hello into Ello it does not replace it, besides :


^  = assert start of subject (or line, in multiline mode)   *


I took this directly from the PHP manual, so i assumed that the default mode
would be the first one, however, i tried the following and it looks like it
was the latter after all

$test = "ello, end this is now the End.";

$test = preg_replace('# *^e#i', 'A',  $test);

Will result into :  Allo, end this is now the End.

So, i guess you were right after all :)

Thanks for sticking with me though!

Best regards from Vienna,
Jürgen


> So you're saying this:
>
>   echo preg_replace("/^[eE]/", "A",  "Eek!");
>
> Does not result in "Aek!" ?
>
> --
> Jason Wong



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Regular Expressions (PCRE library)

2002-08-03 Thread Jason Wong

On Sunday 04 August 2002 03:47, Jürgen wrote:
> Well, i know it should work, but it does not work.
> Even if i Change the first letter into e or E it does not work.
>
> This is so frustrating, this is prolly the most easiest regular expression
> i could start with and yet i fail and nobody seems to know why it aint
> working neither
>
> > 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??

So you're saying this:

  echo preg_replace("/^[eE]/", "A",  "Eek!");

Does not result in "Aek!" ?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
The problem with graduate students, in general, is that they have
to sleep every few days.
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Regular Expressions (PCRE library)

2002-08-03 Thread Jürgen


Well, i know it should work, but it does not work.
Even if i Change the first letter into e or E it does not work.

This is so frustrating, this is prolly the most easiest regular expression i
could start with and yet i fail and nobody seems to know why it aint working
neither

> 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




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Regular Expressions (PCRE library)

2002-08-03 Thread Jason Wong

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 .  "";
>
> //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.
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php