Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 15th, 2012  |  syntax: None  |  size: 0.89 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to remove dots from this combination in PHP
  2. "I am tagging @username1.blah. and @username2.test. and @username3."
  3.        
  4. preg_replace('/@^|(.+)/', '', 'I am tagging @username1.blah. and @username2.test. and @username3. in my status.');
  5.        
  6. "I am tagging @username1blah and @username2test and @username3 in my status"
  7.        
  8. "I am tagging @username.blah and @username2.test and @username3 in my status."
  9.        
  10. php > $a = "I am tagging @username1.blah. and @username2.test. and @username3.";
  11. php > echo str_replace(". ", " ", $a." ");
  12. I am tagging @username1.blah and @username2.test and @username3
  13.        
  14. preg_replace('/.(s+|$)/', '1', $r);
  15.        
  16. preg_replace('/.( |$)/', '1', $string);
  17.        
  18. preg_replace("/(@S+).(?:s|$)/", "$1", $string);
  19.        
  20. $input = "I am tagging @username1.blah. and @username2.test. and @username3. in my status.";
  21. echo preg_replace('/(@S+).(?=s|$)/', '$1', $input);
  22.        
  23. /@w+(.w+)?(?<dot>.)/