In MySQL, replaceregexp is used for regular expression replacement.
This article describes how to replace regular expressions with replace and regexp in MySQL. We will share this with you for your reference. The details are as follows:
Today, a friend asked me to change the format similar to "./uploads/110100_cityhotel_beijingfu .jpg" in the database to "./upload
wildcard characters that can be used in SQL are:
Wildcard characters
Description
%
Override one or more characters
-
Replaces only one character
[Charlist]
Any one character of the word columns
[^charlist] or [!charlist]
Any single character that is not in the word columns
"%": matches any number of characters (0 or more); "_": matches any single c
matches
The range of {n, m} matches (m cannot exceed 255)
SELECT prod_name FROM products WHERE prod_name REGEXP '\ ([0-9] sticks? \\)';
In this statement? Matches zero or one occurrence of any character before it
OPERATOR:
^ Match the beginning of the text
$ Match the end of the text
[[:
[[: >:]] End of a word
SELECT prod_name FROM products WHERE prod_name REGEXP '^ [0-9 \.]';
The matched string indicates that only data starting with. And any number is queried.
How do I use
|
+ ------- + -------- + --------- + ------ + ------------ + ------- +
MySQL provides standard SQL mode matching and a kind of Unix-like UtilityProgramFor example, the format of the extension Regular Expression Pattern Matching of VI, grep, and sed.
Extended Regular Expressi
Tags: like rom oracle ref symbol space newline character value letterThe original in this poke Regexp_like 3 parameters The first one is the string entered The second one is the regular expression The third is the range of values: I: case is not sensitive; C: Case sensitive; N: Point number. Do not match line break symbols; M: multi-line mode; X: Extended mode, ignoring white-space characters in
General email, form such as zhangshan@163.com,abc@sina.com.cn some commonly used forms on the line, but in our company some customers in the mailbox but there are some zhangshna. Mr@163.com,abc_wang.dd@sian.com,abc_wang.dd.cc@sian.com this similar form, before the @ symbol is a little., the original is to use, but not now, have to study the use of the regular
Friends, if there is a regular
last match, that is, it matches the same character again, so it can match two consecutive and identical non-null characters
2. REGEXP_LIKE (x, pattern [, match_option]) is used to find the Regular Expression pattern in x. This function also provides an optional parameter match_option string to indicate the default matching options. The value of match_option is as follows:'C' indicates that the matchi
The regular expression (Regular expression) uses a single string to describe and match a series of strings that conform to a certain syntactic rule. In many text editors, regular expressions are often used to retrieve and replace text that conforms to a pattern. Many program
Location Syntax: Location [=|~|~*|^~]/uri/{...}Default: No Context: Server This command accepts different structures depending on the URL. You can configure the use of regular strings and regular expressions. If you use a regular expression, you must use the ~* prefix to sel
on the server side for further verification)Verify the mobile phone number (including 159, excluding PHS)Verify the phone number (very complicated, VS. NET2005 gave the error)Verify passportVerification IP address, verification domain verification Credit Card (support for Visa card, MasterCard, Discover Card, US Express Card)Verify ISBN international standard document No.Globally Unique GUID VerificationVerify the file path and extensionVerify the Ht
syntax, users can still customize their own stickers, textures, add links, paste web pages, and many other features, it may achieve the same effect of HTML syntax support, and this can greatly improve the security of the Forum against the HTML forum. Users cannot launch any malicious attacks on the forum.Iv. regular expression syntax rules and tagsNow we are going to officially start learning
" meaning, matching a set of optional characters
1? Symbol JO? b matches the O character 0 or 1 times, i.e. Joob,job 2 + Symbols S+eu matches S1 times or any time, such as Sseu,sssseu. But not seu. 3 () and | characters R (e|a) d means selecting any one of the character e,a, Red, rad3. Pass-to-match1. wildcard (globbing) is the process of extending a non-specific file name that contains wildcards to a batch of specific file names stored on a computer,
information record instance is to record the mail address username, and mail address server address (in the form of username@server.com and so on), in the following if you want to read the recorded string, you only need to use the "escape character + record order" to read. For example, "\ 1" is equivalent to the first "[a-zA-Z0-9 _-] +", "\ 2" is equivalent to the second ([a-zA-Z0-9 _-] + ), "\ 3" is the third (. [a-zA-Z0-9 _-]). However, in PHP, ""
MySql official manual study notes 2-MySql fuzzy query and regular expression regular expressions
BitsCN.com
MySQLProvides standard SQL mode matching and extended regular expression mode matching formats.
C # Regular Expression Regex class usage,
I. C # Regular Expression symbol Mode
Character
Description
\
Escape Character, escape a character with special functions into a common character, or vice versa
^
Match the start position of the input string
$
End position of mat
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.