And for those with a deeper understanding, they have an answer that provides the intellectual stimulation they are looking for.
You're vastly overestimating what most SO users come to the site for. They (and I include myself) just want something that'll work and isn't horrible. Even "not horrible" is something I care about but I know that many devs don't.
A lot of those people are novices when it comes to regexes, and it's useful to make it clear that there's some things that are better solved with other tools, even if you can abuse extended regexes syntaxes to solve them.
> If so please give example code below.
The phrasing, especially combined with what time of year it was asked, makes me think it's a homework question from a CS logic course where they have to provide an example showing the answer is "no", and explain why.
In my experience, people sometimes ask for how to solve the more immediate detail they’re working on rather than the broader problem.
https://news.ycombinator.com/item?id=20861806
Edit: page refreshed and sure enough the sibling comment calls it out by name
Edit2: Called it the XYZ problem: https://cohan.io/the-xyz-problem/
The second highest-rated answer is "Evaluate it in a try..catch or whatever your language provides." and it's justified because "Surely the real question is 'how do I validate a regular expression'."
This is a fascinating computer science question and I'm pretty sure the questioner wasn't asking "how do I validate a regular expression" because he would have asked that.