On Wed, Feb 16, 2022 at 01:02:44AM +1100, Chris Angelico wrote:

> Yeah, regexes always look terrible when they're used for simple
> examples :) But try matching a line that has (somewhere in it) the
> word "spam", then whitespace, then a number (or if you prefer: then a
> sequence of ASCII digits). It's easy to write "spam\s+[0-9]+" 

After this thread, I no longer trust that "easy" regexes will do what 
they "obviously" look like they should do :-(

I'm not trying to be funny or snarky. I *thought* I had a reasonable 
understanding of regexes, and now I have learned that I don't, and that 
the regexes I've been writing don't do what I thought they did, and 
presumedly the only reason they haven't blown up in my face (either 
performance-wise, or the wrong output) is blind luck.

Now I have *three* problems :-(


-- 
Steve
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/FEBOS7QOJZSSLZGMVLPHQQM4QWDBMD46/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to