I migrated my project from Eclipse to Android Studio and everything worked fine. In this project I have a Regex which should find all image urls in a json-object I get from an API.
This is the Regex I have:
Pattern pattern = Pattern.compile("https?:\\/\\/[^\"]*?\\.(png|jpe?g|img)");
Matcher matcher = pattern.matcher(obj.toString());
while(matcher.find()) {
ImageBackgroundFetcher.getInstance(mActivity).addImageToLoadingQueue(matcher.group());
}
obj is the JSONObject I have with the image urls. It looks like the following and I would like to extract the url of the image (the bold marked part) {"image":"http:\/\/www.test.de\/media\/2015\/01\/16\/bildtitel.jpg"}
After I migrate the project from Eclipse to Android Studio this Regex isn't working any longer. The matcher.find()-Method did not return true and Android Studio gives me a warning in the code at the regex part "\\/\\/" where it says "redundant character escape"
I already googled but didn't find a solution. Any ideas how to solve the problem would be great, thanks in advance ;)
You can use AS function to check Regex.
Press Shortcut: Alt+Enter → check regexp

![Match result]](https://i.sstatic.net/aTccn.png)

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With