Regular Expressions 101

Community Patterns

No Double space and special character, no leading space ISO-8859-1

1

Regular Expression
PCRE (PHP <7.3)

/
([^\p{Zs}])([^\p{Zs}\p{S}\p{P}])*((\p{Zs}|!|"|#|\$|%|&|'|\(|\)|\*|\+|,|\-|\.|\/|:|;|<|=|>|\?|@|\[|\\|\]|\^|_|`|\{|\||\}|~|¡|¢|£|¤|¥|¦|§|¨|©|«|¬|®|¯|°|±|²|³|´||·|¸|¹|»|¼|½|¾|¿|×|÷)(?!\4)([^\p{Zs}\p{S}\p{P}])*)*
/

Description

Matches everything exept a String with one of the following: Leading or ending space multiple spaces double special character

Submitted by Hunziger - 8 years ago