Python Regular Expressions -part #11 - Re.split

preview_player
Показать описание
In this video series, we will be tackling Python Regular Expressions from beginners to advanced.

This video goes over:

Don't forget to comment on what you would like to see.
Thanks for stopping by =).

Code to Python Regular Expressions series can be found at my github:

Рекомендации по теме
Комментарии
Автор

Thanks for your time and expertise. This was enjoyable and educational. *subscribed*

Xaminn
Автор

7:27 There another solution for this problem as well, is to use the none greedy quantifiers (+? *? ??)
"re.split(r"<.+?>"), string)"

armyofone
Автор

Rumor has it the + greedy quantifier is still going to this day.

divinecaster
Автор

For the list comprehension to remove the empty strings there is not need to use if i != '', you can just say if i

antonybrun
Автор

I enjoy the explanations very much but please try to limit the scrolling.

martinvandenbroek
Автор

At 4:50, could you explain how re.split('<\w+>', string) works?
I thought \w only encompass alphanumeric characters and underscore, a bit confused why we got back ['', 'My mother has <span eyes.', ''] as result

conanh
Автор

its confusing a lot and effecting the learned ones
'<p>My Mother has <span eyes.</p>'
>>> re.split('<.+>', string)
['', '']
it should have only one split right since its started with < (matching at start position) and did not end with > due to .+

rajendram