
Untitled
By: a guest on
Apr 15th, 2012 | syntax:
None | size: 0.89 KB | hits: 9 | expires: Never
How to remove dots from this combination in PHP
"I am tagging @username1.blah. and @username2.test. and @username3."
preg_replace('/@^|(.+)/', '', 'I am tagging @username1.blah. and @username2.test. and @username3. in my status.');
"I am tagging @username1blah and @username2test and @username3 in my status"
"I am tagging @username.blah and @username2.test and @username3 in my status."
php > $a = "I am tagging @username1.blah. and @username2.test. and @username3.";
php > echo str_replace(". ", " ", $a." ");
I am tagging @username1.blah and @username2.test and @username3
preg_replace('/.(s+|$)/', '1', $r);
preg_replace('/.( |$)/', '1', $string);
preg_replace("/(@S+).(?:s|$)/", "$1", $string);
$input = "I am tagging @username1.blah. and @username2.test. and @username3. in my status.";
echo preg_replace('/(@S+).(?=s|$)/', '$1', $input);
/@w+(.w+)?(?<dot>.)/