avatar Bite 2. Regex Fun

Learn Python regular expressions by writing the following 3 functions.

In each function's docstring we show the expected result.

The tests verify these expected results when you hit Save + Verify. We will do a more ample regex bite later on.

Note that for parsing HTML you would use a library of some sort, this is just to train your regex skills.

Update 14th of Aug 2019: we updated the template slightly (text inputs are passed into the functions) to improve the tests for this Bite. If you get confusing result, use Try again to start with the updated template.

Login and get coding
go back Advanced level
Bitecoin 4X

907 out of 1026 users completed this Bite.
Will you be Pythonista #908 to crack this Bite?
Resolution time: ~58 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 4.96 on a 1-10 difficulty scale.
» Up for a challenge? 💪

We use Python 3.8