The caret (^) anchors the start, and the dollar sign ($) the end; : Begin With « Regular Expression « SQL / MySQL






The caret (^) anchors the start, and the dollar sign ($) the end;

      
mysql>
mysql> SELECT 'abcabcabc' REGEXP 'abc{3}';
+-----------------------------+
| 'abcabcabc' REGEXP 'abc{3}' |
+-----------------------------+
|                           0 |
+-----------------------------+
1 row in set (0.00 sec)

mysql>
mysql> SELECT 'abccc' REGEXP 'abc{3}';
+-------------------------+
| 'abccc' REGEXP 'abc{3}' |
+-------------------------+
|                       1 |
+-------------------------+
1 row in set (0.00 sec)

   
    
    
    
    
    
  








Related examples in the same category

1.Pattern Matching: beginning with 'b'
2.String begins with
3.Pattern match: string begin with a certain letter
4.Pattern match: string begin and end
5.Show records where the name begins with a "B"
6.Show records where the name begins with a "B" or "C"
7.Strings that begin with a particular substring:
8.Matches strings that begin with a vowel or end with er:
9.Matches where a is the first character