I have a very simple problem but I am new to Java Matcher and I am having a hard time figuring out how to use it for my specific problem.
I have a string which is something like this <not needed content>src="url"<not needed content>src="url2"<not needed content>
Where <'not needed content'> are the things I want to ignore in my string. I basically want to extract the URLs from the string.
My code currently looks like this
Pattern MY_PATTERN = Pattern.compile("\\src=\"(.*?)\\\"");
Matcher m = MY_PATTERN.matcher(content);
String s = "something";
while (m.find()) {
s = m.group(1);
}
I apologize for such basic, and possibly duplicate question.
Thank you.
"\\srcmeans one whitespace followed byrc. This will never matchsrcassis not whitespace.