update : 2015.11.03
php.shukuma.com

검색:
 
 
Creates a new regular expression

MongoRegex::__construct

(PECL mongo >= 0.8.1)

MongoRegex::__constructCreates a new regular expression

설명

public MongoRegex::__construct ( string $regex )

Creates a new regular expression.

인수

regex

Regular expression string of the form /expr/flags.

반환값

Returns a new regular expression.

예제

Example #1 MongoRegex::__construct() example

This example uses a regular expression to query for all documents with a username field starting (^) with an l and a vowel ([aeiouy]), case-insensitive (/i).

<?php
$luke_search 
= new MongoRegex("/^l[aeiouy]/i");
$cursor $collection->find(array("username" => $luke_search));
?>

참고