DEV Community

Cris Acosta
Cris Acosta

Posted on • Updated on

How are regex used in the real world?

Hey ya'll JavaScript ninjas!

I am currently going through the regex module on FCC and I am just wondering how Regular Expressions are used in the real world and how often is it used?

Top comments (8)

Collapse
 
tux0r profile image
tux0r

Anytime anyone wants to match a pattern, basically.

Collapse
 
developing_dev profile image
Cris Acosta

like passwords and usernames?

Collapse
 
tux0r profile image
tux0r

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.

Thread Thread
 
developing_dev profile image
Cris Acosta

Awesome! Thank you senpai!

Thread Thread
 
link2twenty profile image
Andrew Bone

You can use regex on passwords for complexity checking.

Thread Thread
 
tux0r profile image
tux0r

Indirectly. Regex won't help you with entropy checking.

Thread Thread
 
developing_dev profile image
Cris Acosta

what's "entropy checking" in English again?

Thread Thread
 
tux0r profile image
tux0r • Edited

Checking a password's entropy.