[Solved] username regex in rails 4 [closed]
[ad_1] You could use this regex: ^(\w|\.)+$ Which is the same as: ^[a-zA-Z0-9_\.]+$ Here’s preview of the regex in action on regex101.com, and here’s a breakdown of it ^ matches the beginning of the string ( just groups the characters so a modifier can be applied \w matches any character that is a-z, A-Z, 0-9, … Read more