DEV Community

Discussion on: 4 Practical Use Cases for Regular Expressions

 
deleteman123 profile image
Fernando Doglio

Hey, I'm no master by any means!
I have, however, played around with them quite a lot.
AS for the list of characters you listed, I actually explained in below the code snippet.
This entire chunk (which includes part of your question:

[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]

Checks that the start of the string has valid characters, meaning, characters that a username inside an email address can have (as Wikipedia mentions here: en.wikipedia.org/wiki/Email_addres...).