We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
__toString
preg_match
1 parent b51da69 commit 83121cbCopy full SHA for 83121cb
VerbalExpressions.php
@@ -24,6 +24,11 @@
24
// else
25
// echo "invalid url";
26
27
+// if (preg_match($regex, 'http://github.com')) {
28
+// echo 'valid url';
29
+// } else {
30
+// echo 'invalud url';
31
+// }
32
33
// echo "<pre>". $regex->getRegex() ."</pre>";
34
@@ -280,6 +285,16 @@ function _or( $value ) {
280
285
return $this;
281
286
282
287
}
288
+
289
+ /**
290
+ * PHP Magic method to return a string representation of the object.
291
+ *
292
+ * @return string
293
+ */
294
+ public function __toString() {
295
+ return $this->getRegex();
296
+ }
297
283
298
/**
284
299
* Creates the final regex.
300
* @return string The final regex
0 commit comments