I have an application that stores the relative path of an image file in a DB. I need to remove any fully qualified URL from the path before I insert it into the database. I was using the following.
$('img', this).attr('src').replace(/https?:\/\/[^\/]+/, '');
However, this still puts the / in front of the image path
I start with this http://192.168.72.80/upload/11/img_3070.jpg
and I want to end up with this. upload/11/img_3070.jpg
The URL could be an IP, domain so I have to be able to deal with both scenarios.
Thanks