I need to find picture location in HTML text based on regex.
e.g.
The HTML string is:
<div style='background-image: url(http://www.mydomain.com/images/test.jpg);
background-repeat: no-repeat; background-attachment: scroll; height: 400px;'>
And I need to define a regex that will find the end location of string that starts with http://www.mydomain.com and finishes with ).
- What should be the regex?
- How can I find the end location in java?
http://www.mydomain.comappear elsewhere in the HTML you are parsing? Or can your regex just start with the hard-coded URL and capture the rest?