this post was submitted on 01 Dec 2024
86 points (100.0% liked)
askchapo
22836 readers
200 users here now
Ask Hexbear is the place to ask and answer ~~thought-provoking~~ questions.
Rules:
-
Posts must ask a question.
-
If the question asked is serious, answer seriously.
-
Questions where you want to learn more about socialism are allowed, but questions in bad faith are not.
-
Try !feedback@hexbear.net if you're having questions about regarding moderation, site policy, the site itself, development, volunteering or the mod team.
founded 4 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
The smartest approach to regular expressions is to think about how to avoid needing them in the first place and that is exactly what this bazinga brain will be avoiding now.
The next is that if you do need regular expressions, keep it simple. If your regex is complex, you probably should have broken it down into multiple separate steps and sub-searches.
The next is that if you have determined you do need a very complicated regex, you should probably be writing a parser or using a parser generator so that it can be understood, improved, debugged, etc.
This bazinga is going to be getting a bunch of complex, non-debuggable regexes that are probably subtly wrong.