It is necessary from type links
https://www.google.com/url?rct=j&sa=t&url=http://tower43.ru/b0013232&ct=ga&cd=CAEYACoTMzUwODg1NjAwNzEwMDkwNjAyMjIcM2Q5YzNlZTJkOGNlNDNhNTpydTplbjpSVTpSTA&usg=AFQjCNH-ApyoRaD_cwKMe5tj6JwiB6Qpcg
Get links of the form:
tower43.ru/b0013232
With the help of the service I wrote a regular list that does not work in java-code (returns false)
String pattern = Pattern.quote("/(\\S)(https?:[\\S]*)(&ct=ga&cd=)/"); Pattern p = Pattern.compile(pattern); Matcher m = p.matcher(url); boolean pure_url = m.find(); System.out.println(pure_url);
Moreover, the site writes that there are coincidences.
m.find()
returnstrue
/false
. You need to use.group(1)
-if (m.find()) { System.out.println(m.group(1)); }
if (m.find()) { System.out.println(m.group(1)); }
- Wiktor Stribiżew