Say for example i want to apply a regex on a list of strings.
Using list comprehension as such results in the group method not being found.
```
name_regex = compile(r'\[\"([a-zA-Z\s]*)\"{1}')
named_entities = [name_regex.match(entity.trigger).group(1) for entity in entities[0]]
```
This unexpected behavior can also be observed when implementing this using a map.
```
list(map(lambda x: name_regex.search(x.trigger).group(), entities[0]))
```
However using the traditional for loop implementation the group method is resolved.
```
named_entities = []
for entity in entities[0]:
named_entities.append(name_regex.match(entity.trigger).group(1))
``` |