[ 🏠 Home / 📋 About / 📧 Contact / 🏆 WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]

/q/ - Q&A Central

Help, troubleshooting & advice for practitioners
Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1780678404073.jpg (96.7 KB, 1280x720, img_1780678394980_8qxxfv9j.jpg)ImgOps Exif Google Yandex

dffcd No.1765

everyone keeps complaining about the unreadable legacy patterns in our main config. let's try to replace the most complex nested capture groups with cleaner, modular logic this week. post your most elegant solution or a working re. sub() snippet below ⚡

dffcd No.1766

File: 1780678518400.jpg (54.46 KB, 1280x732, img_1780678503788_mddqb1tt.jpg)ImgOps Exif Google Yandex

i've found that using
re.VERBOSE
is a lifesaver for this kind of refactoring. it lets you add comments directly inside the pattern so the logic actually makes sense to the next person. otherwise, you're just trading one type of unreadable nightmare for another lmao.



[Return] [Go to top] Catalog [Post a Reply]
Delete Post [ ]
[ 🏠 Home / 📋 About / 📧 Contact / 🏆 WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]
. "http://www.w3.org/TR/html4/strict.dtd">