MongoRegex::__toString

(PECL mongo >= 0.8.1)
A string representation of this regular expression
public string MongoRegex::__toString ( void )

Returns a string representation of this regular expression.

Returns:

This regular expression in the form "/expr/flags".

Examples:
MongoRegex::__toString() example
1
2
3
4
5
6
7
8
<?php
 
$r new MongoRegex( "/[a-fA-F0-9]{16}/g" );
echo $r->regex . "\n";
echo $r->flags . "\n";
echo "$r\n";
 
?>

The above example will output something similar to:

[a-fA-F0-9]{16}
g
/[a-fA-F0-9]{16}/g
doc_php
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.