|
|
Subscribe / Log in / New account

Python support for "irregular" expressions

Python support for "irregular" expressions

Posted Feb 23, 2022 8:23 UTC (Wed) by marcH (subscriber, #57642)
In reply to: Python support for "irregular" expressions by brenns10
Parent article: Python support for regular expressions

Same, I enjoyed the "contrast" between:

> As can be seen, regular expressions are a powerful mechanism, but they are complex, can be used inappropriately, and are prone to bugs of various sorts; they are also difficult to test fully and to debug when problems are encountered. [...] They are useful tools, and _started_ life as pretty simple things, with small, elegant, and efficient implementations Feature creep and "faster! faster! faster!" turned the implementations more into bottomless pits now ;-)

and:

> Those who need timeouts, atomic groups, nested character sets, possessive quantifiers, and other advanced footguns ...

Although "timeouts" look more like a security fix than an advanced feature.


to post comments

Python support for "irregular" expressions

Posted Feb 26, 2022 7:22 UTC (Sat) by flussence (guest, #85566) [Link] (1 responses)

> Although "timeouts" look more like a security fix than an advanced feature.

More of a lesson everyone keeps relearning the hard way; PHP got it right 25 years ago, and it stings every time another system for processing arbitrary code+data on the fly gets it wrong (regex, SQL, shaders, CSS, ...)

Python support for "irregular" expressions

Posted Feb 27, 2022 21:06 UTC (Sun) by marcH (subscriber, #57642) [Link]

"Regular expressions" a.k.a: how to make it impossible to sanitize inputs.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds