I am trying to parse the HTML document, and at the same time I understand regulars - I read articles, but as soon as it seemed that I understood everything - in fact it turns out to be wrong.
Specifically - there is a line: <meta property="og:image" content="http://drugoigorod.ru/wp-content/uploads/2016/06/krov_1.jpg" /><link rel="icon"
From it you need to pull out the 2016/06/krov_1.jpg
.
Here is the regular schedule, which I got on the guides that I found and the syntax, as I understood it:
private static Pattern headerImagePattern = Pattern.compile("<meta property=\"og:image\" content=\"http://drugoigorod.ru/wp-content/uploads/(.*)\\S/><link rel=\"icon\"");
What is my mistake, and why he does not find the way I guess? What is the omission / subtlety.
ps I can’t send this template back, it is checked in tests, but for some reason the logs don’t plow there.
pss checkout sites like regex101 will not work, there is a difference in syntax, there is for javascript and php, what works there does not work in Java and vice versa.
String
- Vladyslav Matviienko\S
- it means "any character except whitespace (\ s)", and you just need a space. - zRrr