Organizational Research By

Surprising Reserch Topic

use Regular Expression for in MySQL? Support your answer with an example.


 
Regular expressions are a set of characters. Regular expressions are used for finding certain sequences in strings.
 
The following are the regular expression characters:
 
- * Represents matching characters that are 0 or more occurrences of the string that precedes it.
- + Represents matching characters that are 1 or more occurrences of the string that precedes it.
- ? Represents matching characters that are 0 or 1 occurrences of the string that precedes it.
- . Represents single character pattern matching.
- [abc] Represents matching characters that is either a or b or c 
- | Used for separation of strings
- ^ Finds the matching pattern starting from the beginning.
 
To match the input characters with database tables, REGEXP is used. For example:
 
Select cityname from territories where cityname REGEXP ‘^(jo)*’;
 
The above query returns all city names that has the substring ‘jo’.
 
asked Sep 13, 2013 in MYSQL by rajesh
edited Sep 12, 2013
0 votes
20 views



Related Hot Questions



Government Jobs Opening


...