I know it has already been asked Here however I would like to use named group in java like Pshemo suggested and I can't figure what's wrong with my regex conversion:
Here is the python regexp:
regexp = re.compile(r'(?P<delim>[^\w\n"\'])(?P<space> ?)(?P<quote>["\']).*?(?P=quote)(?P=delim)', re.DOTALL | re.MULTILINE)
matches = regexp.findall(content)
Here is my java converted regexp:
String regexp = "(?<delim>[^\\w\\n\\\"'])(?<space> ?)(?<quote>[\\\"']).*?(?=quote)(?=delim)";
Pattern pattern = Pattern.compile(regexp, Pattern.DOTALL | Pattern.MULTILINE);
Matcher matcher = pattern.matcher(content);
What I am doing wrong ?

(?P=quote)=>(?=quote))