pregMatch() публичный Метод

Example:: String.pregMatch("For more information, see Chapter 3.4.5.1", "/(chapter \d+(\.\d)*)/i") == ['Chapter 3.4.5.1', 'Chapter 3.4.5.1', '.1']
public pregMatch ( string $string, string $pattern ) : array
$string string The input string
$pattern string A PREG pattern
Результат array The matches as array or NULL if not matched
 /**
  * @test
  * @dataProvider pregMatchExamples
  */
 public function pregMatchWorks($string, $pattern, $expected)
 {
     $helper = new StringHelper();
     $result = $helper->pregMatch($string, $pattern);
     $this->assertSame($expected, $result);
 }