. The following command searches the string: yiibai.com, regardless of case:
Copy Code code as follows:
>db.posts.find ({post_text:{$regex: "Yiibai", $options: "$i"}})
The result of this query realignment is that the word Yiibai document is included in the size, as follows:
{
"_id": ObjectId ("53493d37d852429c10000004"),
"Post_text": "hey! This is me post on Yiibai ",
tags": ["Yiibai"]
}
An array element that uses a
do a certain string lookup, but regular expressions can help us to do Fuzzy Lookup, faster and more convenient, just need a regular expression string.
3, various languages are basically supportedRegular expressions are currently supported in mainstream languages such as Java, PHP, Javascript, C #, and C + +.
4, the study is very simple, the application is very
ES2015 Regular Expression new feature, es2015 Regular Expression
New Features of ES2015 Regular Expressions:
Based on the regular expression, ES2015 enhances the support for four-byte u
Objective:Six months ago to the regular expression of interest, found a lot of information on the Internet, read a lot of tutorials, and finally in the use of a regular expression tool Regexbuddy to find his tutorial written very well, can be said to have seen the best
file name, while * matches one or more characters. A file such as 'data ?. The following files can be found in the dat mode:Data1.datData2.datDatax. datDataN. datIf "*" is used instead? Characters to expand the number of files found. 'Data *. dat 'can match all the following file names:Data. datData1.datData2.datData12.datDatax. datDataXYZ. datAlthough this file search method is certainly very useful, it is also very limited .? The limited capabilities of wildcard and * enable you to define wha
the use of JS regular expressions
JS can only enter regular expressions such as numbers or numbers and letters.
JS Regular Expression Daquan (collation detailed and practical)
JS verification phone number and phone support +86 regular
Author: Sema Source: ominous:
I became interested in regular expressions half a year ago. I searched for a lot of information on the Internet, read a lot of tutorials, and finally found that his tutorial was very well written when I used regexbuddy, a regular expression tool, it can be said that it is the best
Php Regular Expression replacement and regular expression replacement functions/* Below we want to replace the null in the specified regular expression with another content. In this case, we need to use the
At the beginning, you have to say ^ and $ they are used to match the start and end of a string, respectively, as illustrated below
If you're a novice, guess you're canceling the regular expression 30 minute introductory tutorial
"^the": The beginning must have "the" string;
"Of despair$": The end must have a string of "of despair";
So
"^abc$": a string that requi
Objective:
Six months ago, I was interested in regular expressions, found a lot of information on the Internet, read a lot of tutorials, and finally in the use of a regular expression tool Regexbuddy to find his tutorial written very well, can be said that I have seen the best regu
The template engine based on regular expression substitution can easily meet the limit of the maximum backtracking/recursion of regular expressions.
Lazy matching is not scary, normally the template is not enough, often does not exceed the limit, the Discuz template engine is heavily used. But instead of paying attention and not learning, it is easy to write mist
}[]? ([-]? ((\d) | []) {1,12}) +$/;
if (!patrn.exec (s)) return false
return True
}
Check mobile phone Number: Must start with a number, in addition to the number, can contain "-"
Copy Code code as follows:
function Ismobil (s)
{
var patrn=/^[+]{0,1} (\d) {1,3}[]? ([-]? ((\d) | []) {1,12}) +$/;
if (!patrn.exec (s)) return false
return True
}
Check ZIP code
Copy Code code as follows:
function Ismobil (s)
{
var patrn=/^[+]{0,1} (\
Regular Expression \ w \ d interpretation, Regular Expression
After reading the descriptions of many related regular expressions, I found that the meaning of \ w is equivalent to [0-9a-za-z]. (Based on the regular
In the php tutorial, the regular expression matches the regular expression method of unicode encoding. Because of the special nature of unicode encoding, the General Chinese or English regular expressions cannot obtain the expecte
Although the cloud-dwelling community has previously made a lot of regular expression tutorials, but this article is still good, no nonsense are more practical, the premise is that you need to understand the point of the regular expression before, or first look at some basic regula
In the php Tutorial, the regular expression matches the regular expression method of unicode encoding. Because of the special nature of unicode encoding, the general Chinese or English regular expressions cannot obtain the expecte
The original English text comes from smashing Magazine. Translated by Woole. Reprint please indicate the source.
Regular Expressions (Regular Expression, abbr. Regex) are powerful and can be used to find the information you need in a large string of words character. It takes advantage of the conventional character-structure expressions to function. Unfortunatel
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.