I've seen JavaScript parses for this, but not any suitable MySQL ... I have a column in my database that contains a string like this:
http://localhost/mysite/wp-content/uploads/2012/10/huge_eye-150x150.jpg
I need to be able to remove every part of that string except 2012/10/huge_eye-150x150.jpg
So I need to remove http://localhost/mysite/wp-content/uploads/
... but keep in mind that not ALL of the rows will contain exactly http://localhost/mysite/wp-content/uploads/
... some may contain a slightly different string because of a legacy system ... that's why I thought it might be most appropriate to find the third to last occurrence of /
Perhaps you have a better solution? Thank you!
Something like:
SUBSTRING_INDEX(url,'/',-3)