I have a string that has two single quotes in it, the \' character. In between the single quotes is the data I want.
\'
How can I write a regex to extract
Some how the group(1) didnt work for me. I used group(0) to find the url version.
Pattern urlVersionPattern = Pattern.compile("\\/v[0-9][a-z]{0,1}\\/"); Matcher m = urlVersionPattern.matcher(url); if (m.find()) { return StringUtils.substringBetween(m.group(0), "/", "/"); } return "v0";