I have a part of HTML from a website in the below String format:
srcset=" /tesla_theme/assets/img/homepage/mobile/[email protected]?20170808 200w, /tesla_theme/assets/img/homepage/mobile/[email protected]?20170808 338w, /tesla_theme/assets/img/homepage/mobile/[email protected]?20170808 445w, tesla_theme/assets/img/homepage/mobile/[email protected]?20170808 542w, /tesla_theme/assets/img/homepage/mobile/[email protected]?20170808 750w"
I want to add http://tesla.com in front of all the urls in the srcset element like http://tesla_theme/assets/img/homepage/mobile/[email protected]?20170808 750w
I believe this could be done using regex, but I am not sure.
How do I do this using Java if I have multiple srcset elements in a html string variable, and I want to replace all of the srcset url.'s and add the server url in front?
Note: The /tesla_theme will not be consistent, so I cannot use replaceAll, instead, i will have to use regex.