Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Created·2016-01-12 06:21
Flavor·Python

r"
^(?=.{4,32}$)(?![_.-])(?!.*[_.]{2})[a-zA-Z0-9._-]+(?<![_.])$
"
Open regex in editor

Description

username is 4-32 characters long no _,- or . at the beginning no __ or . or . or .. or .- or _- inside no _,- or . at the end

^(?=.{4,32}$)(?![.-])(?!.*[.]{2})[a-zA-Z0-9.-]+(?<![.])$

Submitted by Rajesh Jayaswal