4 ms·
> our pattern becomes: > \A(?=\w{6,10}\z)(?=[^a-z][a-z])(?=(?:[^A-Z][A-Z]){3})(?=\D\d). And then these guys wonder why people hate regexes? The "now you have
by d--b 9y ago
> our pattern becomes:
> \A(?=\w{6,10}\z)(?=[^a-z][a-z])(?=(?:[^A-Z][A-Z]){3})(?=\D\d).
And then these guys wonder why people hate regexes? The "now you have 2 problems" quote fit perfectly for that case.
- pygy_ 9y agoThe regexp syntax was devised for write-only programming at the terminal (at a time when a terminal was a physical object, not a window in your GUI). The regular formalism is pretty neat though. There are alternative syntaxes (e.g. multiline regexps in Python) that are better suited for complex matchers.
- jokoon 9y agoCan you put line returns and indents in a regex? If you escape them it should work, I guess.