Question about Regular Expression From Video 11 B


In the following challenge:

The regular expression is provided in the question:

import re
s = 'A message from to about meeting @2PM'
lst = re.findall('\\S+@\\S+', s)

However, it says it will match the following:

['', '']

The issue is that, shouldn’t this not work?

the \\ should escape the backslash. So it should be checking a back slash, followed by one or more Capital S, a @ sign, a backslash, and then one or more Capital S.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.