Regular Expressions (PCRE library)

From: Date: Sat, 03 Aug 2002 17:44:19 +0000
Subject: Regular Expressions (PCRE library)
Groups: php.general 
Request: Send a blank email to php-general+get-110979@lists.php.net to get a copy of this message
Hello! It´s driving me nuts, am in the middle of reading Mastering Regular Expressions (O'Reilly), and because i like to learn whilst doing, well, you can picture the rest. 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); //after echo $tes; Now i know damn well that this is a real simple example, and thus failing here already makes me feel quite frustrated. Any help or explanations as to what is wrong in the above example along with a little explanation would be greatly appreciated! Thanks a lot in advance for your time reading. Best regards from Vienna, Jürgen

« previous php.general (#110979) next »