
March 29, 2022
6:09 p.m.
On Tue, Mar 29, 2022 at 12:35:56AM -0700, Paul Bryan wrote:
I wonder if applying regular expressions would sufficiently address your use case.
'Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.' -- Jamie Zawinski Apart from (probably) being slower and harder to understand, what benefit would a regular expression bring to this problem? Julio already has a working solution that does exactly what he wants:
I have implemented this function locally to use it for my personal projects and It has proven to be really useful in practice, so I hope you find it useful as well and consider adding it as a class method for strings in Python.
-- Steve