bwakad Posted September 1, 2014 Share Posted September 1, 2014 In a form I use this: elseif (!preg_match("/^[A-Za-z0-9]{6,16}$/", $input->post->password)) { In the backend of PW there is a pattern setting under INPUT tab of the field. But, how to enter this there? Can't find info on that. With slashes: /^[A-Za-z0-9]{6,16}$/ Just beginning and end of string: ^[A-Za-z0-9]{6,16}$ Or only this: [A-Za-z0-9]{6,16} Link to comment Share on other sites More sharing options...
LostKobrakai Posted September 1, 2014 Share Posted September 1, 2014 The Slashes ( / ) are a php specific thing to implement regex patterns, while the two patterns below are different ones. The first one does only match if the input is a single word, while the latter would also match "Passwrd Passwrd" see: http://regexr.com/39e12 vs. http://regexr.com/39e18 Edit: To answer a little bit more clearly, the second one is the one you should put in the field of the processwire backend, to reflect the first pattern. 1 Link to comment Share on other sites More sharing options...
bwakad Posted September 1, 2014 Author Share Posted September 1, 2014 Hey thanks! Cool site to check patterns. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now