public function testOptional() { $regEx = $this->r->min(1)->max(3)->of("p")->exactly(1)->of("dart")->optional($this->r->getNew()->exactly(1)->from(array("p", "q", "r")))->getRegExp(); $this->assertTrue($regEx->matches("pdartq")); }
public function testSomething() { $regEx = $this->r->min(1)->max(3)->of("p")->something()->getRegExp(); $this->assertTrue($regEx->matches("pphelloq")); $this->assertFalse($regEx->matches("p")); }