Maybe that's a bit shorter and easier to understand:
>>> import re>>> text = '... someline abc... someother line... name my_user_name is valid.. some more lines'>>> re.search('name (.*) is valid', text).group(1)'my_user_name'
Maybe that's a bit shorter and easier to understand:
>>> import re>>> text = '... someline abc... someother line... name my_user_name is valid.. some more lines'>>> re.search('name (.*) is valid', text).group(1)'my_user_name'