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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With