Created
June 20, 2017 21:08
-
-
Save sandeep1995/dd294bdec416ce0b556d2996fd7a77b0 to your computer and use it in GitHub Desktop.
Find all the matches of xlink:href="<---I NEED THIS --->" from one SVG String
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void findEmbeddedImages() { | |
Pattern pattern = Pattern.compile("([^[-\\\\w.]+$\\/\\:\\.]*\\.(jpg|jpeg|png|gif))", Pattern.CASE_INSENSITIVE); | |
// Pattern pattern = Pattern.compile("xlink:href=\"[^\"]*\"", Pattern.CASE_INSENSITIVE); | |
Matcher matches = pattern.matcher(this.svg); | |
while (matches.find()) { | |
System.out.println("Match Found: " + matches.group()); | |
this.links.add(matches.group()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am using the above code in my ruby application. This RegEx does work in the Ruby application. But I can not get it work in Java.