@@ 67-74 (lines=8) @@ | ||
64 | * @param array|null $matches |
|
65 | * @return bool |
|
66 | */ |
|
67 | public function match_beginning($str, $dotall = false, &$matches = null) { |
|
68 | if (!$dotall) { |
|
69 | return preg_match($this->delim."^".$this->regexp.$this->delim, $str, $matches) === 1; |
|
70 | } |
|
71 | else { |
|
72 | return preg_match($this->delim."^".$this->regexp.$this->delim."s", $str, $matches) === 1; |
|
73 | } |
|
74 | } |
|
75 | ||
76 | /** |
|
77 | * Search a string with the regexp. |
|
@@ 84-91 (lines=8) @@ | ||
81 | * @param array|null $matches |
|
82 | * @return bool |
|
83 | */ |
|
84 | public function search($str, $dotall = false, &$matches = null) { |
|
85 | if (!$dotall) { |
|
86 | return preg_match($this->delim.$this->regexp.$this->delim, $str, $matches) === 1; |
|
87 | } |
|
88 | else { |
|
89 | return preg_match($this->delim.$this->regexp.$this->delim."s", $str, $matches) === 1; |
|
90 | } |
|
91 | } |
|
92 | } |
|
93 | ||
94 |