I-PHP.d Exercise PHP-RegExp
Emmanuel Benoist Home Page

Exercise PHP-Regular Expressions


Solution

Find an expression

Write a PHP program that counts the number of time your name occures in a document

Find and replace

Write a PHP program that transforms all occurences of www.hti.bfh.ch into www.ti.bfh.ch.

A more complicated RegExp

Write the PHP program for changing any student address name.surname@hti.bfh.ch into kuerzel@bfh.ch. We suppose all users are students and have number 1, that means that the kuerzel is 4 first letters of the surname and the very first letter of the first name, plus number 1.