Question: This is not a duplicate.. in my belief. I'm not asking about its usefulness. I ask for clarification of definition, if I may. Instead of downvoting, kindly, explain. Then I'll remove this post if I deem stupid for the rest of the readers.

```
f=re.match(pattern, str)
pattern= '(?:animal)(?:=)((\w+),)+'
str = 'animal=cat,dog,cat,tiger,dog\nanimal=cat,cat,dog,dog,tiger\nanimal=dog,dog,cat,cat,tiger'

```

which shows like this

```
animal=cat,dog,cat,tiger,dog
animal=cat,cat,dog,dog,tiger
animal=dog,dog,cat,cat,tiger

```

If what is after ?: should be 'A non-capturing version of regular parentheses. Matches whatever regular expression is inside the parentheses, but the substring matched by the group cannot be retrieved after performing a match or referenced later in the pattern.'

Why does it still return the string 'animal='?

(Python 3.6.3)
f is :

```
<_sre.SRE_Match object; span=(0, 25), match='animal=cat,dog,cat,tiger,'>
f[0]
'animal=cat,dog,cat,tiger,'
f[1]
'tiger,'
f[2]
'tiger'

```

Answer: 
`(foo)` is a capture group. `(?:foo)` is a non capture group. `(?<foo>bar)` is a named capture group, where the name is "foo".

The thing with capture groups is that they can later be referenced by referring to the capture group number, or if it is named, the name of the group. It's helpful for when you're trying to separate the match into chunks.
When matching a regular expression, anything in the parenthesis () is considered a group. Group 0 is the entire matched string, while groups 1,... are the subgroups identified by () in regular pattern.

```
import re
rr = '(?:animal)(?:=)((\w+),)+'
mystr="animal=cat,dog,cat,tiger,dog"
res = re.search(rr,mystr)
res.group(0)
res.group(1)

```

Using <https://pythex.org/> you can also test against the groups