Facebook Username Search – Regex

This small regex will help you search for Facebook username within a text string or validate data input from a string to match a Facebook username. To check if a part of a string can contain a Facebook username remove the ^ and $. If both of them are kept then the entire string must match a Facebook username. As the time of this writing, a Facebook username can contain up to 50 letters. Allowable letters are alphabet characters number and dot.

/^([a-zA-Z0-9.]){1,50}$/g

This post was written by Kevin and was first post @ http://kevinhng86.iblog.website.
Original Post Name: "Facebook Username Search – Regex".
Original Post Link: http://kevinhng86.iblog.website/2017/01/22/facebook-username-search-regex/.

Advertisement


Random Article You May Like

Leave a Reply

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

*
*