4 ms·
The given regular expression does not match `blabber`, it matches `blabbe` (minus the `r`). I got that one wrong as well. The question should have been "which
by tobyhinloopen 9y ago
The given regular expression does not match `blabber`, it matches `blabbe` (minus the `r`).
I got that one wrong as well. The question should have been "which regular expression FULLY MATCHES X and not Y"
- StavrosK 9y agoNope: In [3]: re.search("b[l].*e", "blabber") Out[3]: <_sre.SRE_Match at 0x7f2db79ed030> "Matches" means "matches". If they wanted "fully matches", they should have specified "^$". That's why anchors exist.
- tobyhinloopen 9y agoYes, I agree. I just explained where it went wrong and that "Match" can mean multiple things. It matches `blabber`, but the match result is `blabbe`.
- deleted 9y ago[deleted]