I am trying to find a regular expression that groups a word that ends with two identical characters followed by 'ter' and splits it into two characters. Example: the word "letter" should be grouped into "Let" and "ter". I am using python, and this is what I got so far:
match = re.search(r'(\w*)((\w)\1(er$))', str) print match.group(1)
The problem is that (\ w) \ 1 does not belong to the right group, since it is a group inside the group. How to solve this?
Thanks in advance.
source share