Anytime anyone wants to match a pattern, basically.


Technically, yes. Practically, that does not make much sense. Why would anyone limit the pattern for usernames or passwords?

Better examples: Zip codes, phone numbers, HTML tags. I use regex to cross-post HTML-formatted articles with BBCode into web forums. E-mail addresses won't work though.

Classic DEV Post from Dec 2 '18

What are your programming goals for 2019?

Share your programming goals for next year!