Example #1
0
 protected function nationalCodeRegEx($code)
 {
     $data = explode('$1', $code);
     $result = GenRegEx::separateString($this->onlyNumbers($data[0]), $this->separator) . $this->separator;
     $result .= '$1';
     if (isset($data[1])) {
         $result .= $this->separator . GenRegEx::separateString($this->onlyNumbers($data[1]), $this->separator);
     }
     return $result;
 }
Example #2
0
 public function testHtmlTag()
 {
     $gen = new GenRegEx();
     $regEx = $gen->htmlTag('<div class="hello world" id="test_id">');
     $this->assertEquals('<div[^>]*\\s*[^>]*class\\s*=\\s*["\']?hello\\s*world["\']?\\s*[^>]*id\\s*=\\s*["\']?test_id["\']?[^>]*>', $regEx);
 }