0

how can I get the string form <a to the first > or instead of it, how can I get value of href?

I tried it but it's get from open a to close span

String str = "<span class=\"foo\"><a href=\"http://www.foo.com/bla\" boo=\"blabla\">click here</a></span>";
Pattern pattern = Pattern.compile("<a href.*>");
Matcher matcher2 = pattern2.matcher(str);
matcher.find();
matcher.group();
xedo
  • 1,117
  • 3
  • 18
  • 34

0 Answers0