Replace all Emails in all php files using Linux sed with php
Posted: Fri Mar 12, 2010 8:36 am
Hi All,
I have a problem while replacing all Email Id's in a directory of .php files with some other email id using linux sed function and php system function.Here the code looks like this,
//
$data="find . -name "*.php" | xargs sed -i s/^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$/nagarajuv@gmail.com/g";
system($data);
//
when I use Email id in place of regular expression it is working fine.Can anyone help me in this
Thanks,
Nagarajuv
I have a problem while replacing all Email Id's in a directory of .php files with some other email id using linux sed function and php system function.Here the code looks like this,
//
$data="find . -name "*.php" | xargs sed -i s/^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$/nagarajuv@gmail.com/g";
system($data);
//
when I use Email id in place of regular expression it is working fine.Can anyone help me in this
Thanks,
Nagarajuv