I need to do a string substitution/replacement via regex and I just can't figure it out.
The string is in the following format:
http[s]://assets.example.com/images/[8 or 9 alphanumberic chars]m/[ 8 or 9 different alphanumeric chars].jpg
The character I want to replace is the m
in the middle of the 2 alphanumeric strings.
Here's an example of what I'm trying to do.
http://assets.example.com/images/11233434m/23435436.jpg
and I want to change it into http://assets.example.com/images/11233434l/23435436.jpg
I'm familiar with str.replace
, I just can't come up with a regex that works, without replacing incorrect characters (like the last m
in example.com/
)