|
|
|
|
|
by JTyQZSnP3cQGa8B
1175 days ago
|
|
Or you can use "verbose regex" which some languages implement like in Python (https://docs.python.org/3/library/re.html#re.X). The spaces are ignored and you can add comments on each line. I used this in the past and my coworkers were happy about it because they could understand the regex and even modify it. |
|
How did I not know about this! Thank you very much. This solves my biggest gripe with regex.
> my coworkers were happy about it because they could understand the regex and even modify it.
The most important point. Computers might read code efficiently, but if people can't reason about it, that is a recipe for bugs to sneak in.