The unintended result from the suggested regex solution

Hi, I’m at the instructions section on the link below.

https://app.dataquest.io/m/369/advanced-regular-expressions/7/substituting-regular-expression-matches

However, I got a few lines that I think are not correct by using the proposed solution, instead of my approach, please check my attached notebook, where I tried to demonstrate the issue, and let me know which regex pattern is the right choice.
regex02.ipynb (6.7 KB) regex02.csv (408 Bytes)

To make the assessment easier, I attached the notebook in image format.



Click here to view the jupyter notebook file in a new tab

Hi @italo.moises

If you want to check only the word email or emails and its other forms, then the second one is perfect. Because when you specify word boundary (\b), then it looks for a word, and in the first case, due to no word boundary, it will select hate mail and voicemail type of line or word.

Got your point but, upon looking at what the regex should match, that does not fit the description. Down below, aren’t these the strings that should be replaced?

email

The whole point here is that students spend considerable time writing a solution like me. However, when you click on the submit button, the programmer figures out that its answer is wrong and the career track progress bar does not move. Tuns out that hate mail and voicemail aren´t anything like e-mail or its variations, and if those got replaced, you’d end up with a title with no meaning at all. I’m a rookie Python leaner, though I think that solution is not 100% correct.

1 Like

I think the aim of exercise is to make you aware about how to substitute strings using regex and understanding the writing of regular expressions. And if you want any correction or found any bug you can submit a ticket here.