pregReplace() public method

Perform a regular expression search and replace on the given string.
public pregReplace ( string $str, string $pattern, string $replacement = '', integer $limit ) : string
$str string
$pattern string
$replacement string
$limit integer
return string Same string where first character is in upper case
Example #1
0
 public function testPregReplaceWithReplacementWithLimit()
 {
     $app = $this->getApp();
     $handler = new TextHandler($app);
     $result = $handler->pregReplace('One koala, two koalas, three koalas, four!', '#(ko)a(la|las)#', 'clippy', 2);
     $this->assertSame('One clippy, two clippys, three koalas, four!', $result);
 }