Hacker News new | past | comments | ask | show | jobs | submit login

> 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.




The 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.


Can you put line returns and indents in a regex?

If you escape them it should work, I guess.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: