PHP - Manual: MongoRegex::__toString
2024-12-25
(PECL mongo >= 0.8.1)
MongoRegex::__toString — 正则表达式的字符串表达形式
This extension that defines this method is deprecated. Instead, the MongoDB extension should be used. Alternatives to this method include:
返回该正则表达式的字符串表示形式。
此函数没有参数。
以 "/expr/flags" 形式的正则表达式。
Example #1 MongoRegex::__toString() 例子
<?php
$r = new MongoRegex( "/[a-fA-F0-9]{16}/g" );
echo $r->regex . "\n";
echo $r->flags . "\n";
echo "$r\n";
?>
以上例程的输出类似于:
[a-fA-F0-9]{16} g /[a-fA-F0-9]{16}/g