← Back to challenges

Extracting Words with "-ing" Inflection

PythonHardregexstrings

Instructions

Write a function that takes a string as an argument and returns a list of all the words inflected by "-ing". Your function should also exclude all the mono-syllabic words ending in "-ing" (e.g. bing, sing, sling, ...). Although these words end in "-ing", the "-ing" is not an inflection affix.

Examples

ing_extractor("coming bringing Letting sing") ➞ ["coming", "bringing", "Letting"]

ing_extractor("going Ping, king sHrink dOing") ➞ ["going", "dOing"]

ing_extractor("zing went ring, ding wing SINk") ➞ []

Notes

  • Mono-syllabic means a word containing just one syllable.
  • It's probably best to use RegEx for this challenge.
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.