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'