Replies: 2 comments 3 replies
-
I'm not at that part yet, but is it maybe because you left a space between them by accident? Like: re.compile__(r'</?\w{2,}>') when I assume it should be: re.compile(r'</?\w{2,}>') ? Ignore me if I'm completely wrong lol, this was just a guess |
Beta Was this translation helpful? Give feedback.
1 reply
-
@nellcla you are doing it a bit too fast - you need to first define the regex and then, separately, compile it. if you look at the next bit of the exercise you may see that the compilation is only the next part? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!,
Can I write about Ex.3? Hope so,
I am doing the regular expression and some of my tries have been:
pattern = re.compile (r'</?\w{2,}>')
pattern = re.compile (r'</?\w{2,}.?>')
pattern = re.compile (r'<.?\w{2,}.?>')
For all of these answers I receive the same errors:
[TMC] Your regular expression could not find both opening and closing tags. Did you use all the parts of a regular expression mentioned in the exercise?
[TMC] The variable "pattern" was defined successfully! 1 point.
[TMC] The variable "pattern" does not contain a string object. Remember that the regular expression must be defined using a string object!
Could you suggest what I am doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions