content_image/863215.jpg content_image/863216.jpg content_image/863217.jpg content_image/863218.jpg
<img src='content_image/863215.jpg'>

To find names containing a w : 

<img src='content_image/863216.jpg'>

To find names containing exactly five characters, use five instances of the _  pattern character: 

<img src='content_image/863217.jpg'>

The other type of pattern matching provided by MySQL uses extended regular expressions. When you test for a match for this type of pattern, use the REGEXP_LIKE()  function (or the REGEXP  or RLIKE  operators, which are synonyms for REGEXP_LIKE() ). 

The following list describes some characteristics of extended regular expressions: 

• .  matches any single character. 

•A character class [...]  matches any character within the brackets. For example, [abc]  matches a , b , or c . To name a range of characters, use a dash. [a-z]  matches any letter, whereas [0-9]  matches any digit. 

• *  matches zero or more instances of the thing preceding it. For example, x*  matches any number of x characters, [0-9]*  matches any number of digits, and .*  matches any number of anything. 

•A regular expression pattern match succeeds if the pattern matches anywhere in the value being tested. (This differs from a LIKE  pattern match, which succeeds only if the pattern matches the entire value.) 

•To anchor a pattern so that it must match the beginning or end of the value being tested, use ^  at the beginning or $  at the end of the pattern. 

To demonstrate how extended regular expressions work, the LIKE  queries shown previously are rewritten here to use REGEXP_LIKE() . 

To find names beginning with b , use ^  to match the beginning of the name: 

<img src='content_image/863218.jpg'>

To force a regular expression comparison to be case-sensitive, use a case-sensitive collation, or use the BINARY  keyword to make one of the strings a binary string, or specify the c  match-control character. Each of these queries matches only lowercase b  at the beginning of a name: 

