I think this is a very bad idea, it is much better to learn regex from regular-expressions.info.
I think having a single line complex regex is a code smell. It is a much better approach to build it from sub-patterns or use multiple regex patterns or don't use regex at all. I Have a small example as evidence (note that the code is not tested or not even written in an editor):
Using a single complex pattern (common golden hammer mistake):
I think this is a very bad idea, it is much better to learn regex from regular-expressions.info.
I think having a single line complex regex is a code smell. It is a much better approach to build it from sub-patterns or use multiple regex patterns or don't use regex at all. I Have a small example as evidence (note that the code is not tested or not even written in an editor):
Using a single complex pattern (common golden hammer mistake):
Using multiple small patterns in combination with language features:
Building the pattern from sub-patterns: