Organizational Research By

Surprising Reserch Topic

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



asked Sep 13, 2013 in MYSQL by rajesh
edited Sep 12, 2013
0 votes
13 views



Related Hot Questions

1 Answer

0 votes

 

 
Regular expressions in MySql are used in queries for searching a pattern in a string.
 
* Matches 0 more instances of the string preceding it.
+ matches 1 more instances of the string preceding it.
? Matches 0 or 1instances of the string preceding it.
. Matches a single character.
[abc] matches a or b or z
| separates strings
^ anchors the match from the start.
REGEXP can be used to match the input characters with the database.
 
Example:
 
The following statement retrieves all rows where column employee_name contains the text 1000 (example salary):
 
Select employee_name
From employee 
Where employee_name REGEXP ‘1000’
Order by employee_name
 
“.” Can be used to match any single character. “|” can be used to match either of the two strings
 
MySQL disadvantages - September 30, 2009 at 18:00 pm by Vidya Sagar
 
answered Sep 13, 2013 by rajesh
edited Sep 12, 2013

...