I am storing values in database like this
www/content/lessons/40/Digital Library/document1.doc
I need to extract the file document.doc.
How to retrieve this value from mysql using regular expression.
I am storing values in database like this
www/content/lessons/40/Digital Library/document1.doc
I need to extract the file document.doc.
How to retrieve this value from mysql using regular expression.
you not need to use regexp (low performence) use substring_index instead
SELECT SUBSTRING_INDEX('bbb/bbbbbb/bbbbbbbbb/bbbb', '/', -1);
link :
http://dev.mysql.com/doc/refman/5.1/en/string-functions.html#function_substring-index
SELECT * FROM documents WHERE name REGEXP "<your regexp here>"
More info: Mysql Regexp Manual