I'm trying to perform a find/replace on the src attribute of an image tag, to remove part of the filename of the image. I assume I need to use str.replace(), but I'm not sure how to write the regex to accomplish what I'm trying to do.
The src attribute is currently
http://domain.com/path/to/file/D063DC58-6051-4B24-8CDC-D4525F72A150_tn.jpg
where /to/file/xxxxxxx_tn.jpg will vary, with the filename always ending in _tn.jpg. I'd like to remove the _tn from each instance on the page.