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

Returns the length of the match, or
null
. The scan @mlink{$pointer} is not advanced.
public match ( string $pattern ) : integer
$pattern string
Результат integer
Пример #1
0
 public function testMatchedAndGetMatched()
 {
     $s = new StringScanner('test string');
     $this->assertEquals(4, $s->match('/\\w+/'));
     $this->assertEquals('test', $s->matched);
     $this->assertTrue($s->matched());
     $this->assertNull($s->match('/\\d+/'));
     $this->assertNull($s->matched);
     $this->assertFalse($s->matched());
 }