I'm new on this topic for python 3.6. What is the difference \S*..\S* and \S+..\S+?
**import re
s = 'A message from csev@umich.edu to cwen@iupui.edu about meeting @2PM'
lst = re.findall('\S+@\S+', s)
print(lst)**
[a-zA-Z0-9]\S*@\S*[a-zA-Z]
I'm new on this topic for python 3.6. What is the difference \S*..\S* and \S+..\S+?
**import re
s = 'A message from csev@umich.edu to cwen@iupui.edu about meeting @2PM'
lst = re.findall('\S+@\S+', s)
print(lst)**
[a-zA-Z0-9]\S*@\S*[a-zA-Z]
\S
means it will match non-whitespace characters.+
means it will match 1 or more of the preceding token.*
means it will match 0 or more of the preceding token.So in that case the \S+
means it will match 1 or more non-whitespace characters where as \S*
will match 0 or more.