A Good Regex For Creating Usernames

A regular expression (called regex) is a way for a programmer to instruct how a program should look for a specified pattern in text and then what it should do when each pattern match is found. Rather than going through each character of a string and doing matches, regex makes life easier for programmers to do search and matches. This sample regex is a good pattern for use in creating usernames.

The regex below means that only alphanumeric (only lowercase letters) are allowed including an underscore and a dot.

Related Posts Plugin for WordPress, Blogger...

Leave a Reply

Your email address will not be published. Required fields are marked *