Take url http://www.abc.com/alpha/beta/33445566778899/gamma/delta
I need to return a number 33445566778899(with a slash removed, the number has a variable length, but from 10 to 20 digits)
Simple enough (or so I thought), except that what I tried seems to not work, but why?
Pattern pattern = Pattern.compile("\\/([0-9])\\d{10,20}\\/");
Matcher matcher = pattern.matcher(fullUrl);
if (matcher.find()) {
return matcher.group(1);
}
source
share