[Solved] python string parse with @ and space [closed]


It is not very hard to write an expression for this.

>>> import re
>>> re.findall(r'@(\S+)', ' I want to tell @susan and @rick that I love you all')
['susan', 'rick']

Or use \w which matches any word character.

>>> re.findall(r'@(\w+)', ' I want to tell @susan and @rick that I love you all')
['susan', 'rick']

1

solved python string parse with @ and space [closed]