Mysql Regular Expression Query

Source: Internet
Author: User
Regular Expression matching query: wildcard. english periods, matching any single character; * matching 0 or more characters before it; x * Indicates matching any number of x characters [...] match any [abc] character in brackets. Match a, B, or c [a-z]. match any letter. [0-9] match any number. [0-9] * ^ represents a character or string

Regular Expression matching query: wildcard. english periods, matching any single character; * matching 0 or more characters before it; x * Indicates matching any number of x characters [...] match any [abc] character in brackets. Match a, B, or c [a-z]. match any letter. [0-9] match any number. [0-9] * ^ represents a character or string

Regular Expression matching query:

Wildcard

. English periods, matching any single character;

* Matches 0 or more characters before it;

X * Indicates matching any number of x characters.

[...] Matching any character in brackets

[Abc] matches characters a, B, or c

[A-z] matches any letter.

[0-9] matching any number

[0-9] *

^ Indicates starting with a character or string ^ a indicates starting with the letter

$ Indicates ending with a character or string x $ indicates ending with the letter s

SELECT prod_name FROM products WHERE prod_name REGEXP '^ NB 'order BY prod_name;


To be case sensitive, you can use the BINARY keyword. For example, WHERE prod_name regexp binary 'jetpack. 000'

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.