When I use Java with this code:
public static void main(String[] args) {
Pattern p = Pattern.compile("(abc)+");
String s = "abcabc d abc";
Matcher m = p.matcher(s);
while(m.find()){
System.out.println(s.substring(m.start(), m.end()));
}
}
It gives me 'abcabc , abc' as I expect.
When I try to do the same using python 3
import re
s = 'abcabc d abc'
p = re.compile('(abc)+')
res = p.findall(s)
print (res)
It gives me strange 'abc', 'abc' What am I doing wrong?