Jump to content

Paradoxz

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Paradoxz's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Excellent script as well, I am trying to get better at Regex (hence the more complicated approach I took) Thanks for your help!
  2. The end of line modifier is working great and limiting it at 12. See code below, you can also try it here: http://failbet.com/acct/add.php // password validator $passpattern = "/^(\d|[a-z]){8,12}$/"; if(!preg_match($passpattern, $_POST['pass'])) { header("location:add.php?errorcode=5"); die(''); } Thanks again everyone!
  3. Fugix, great advice on the /i Not sure why, but on my email validator and password validator I don't use /i and I only specify a-z not a-zA-Z and it works fine for upper or lower case, so I always omit the /i and A-Z
  4. Ah yes, the ^ begins with and $ ends with. It works now that they are added, how dumb of me to forget them. /^(\d|[a-z]){8,12}$/ is what I used. it's the same as you wrote, except \d is identical to 0-9 I guess having to throw | in there makes it the same amount of characters though, and probably the same speed. thank you.
  5. Yes, Regex.. everyone's most feared topic. I hope some brave soul can help. Trying for password validation, numbers and letters only allowed and 8-12 characters. I have tried hundreds of combinations, the one below is the closest I have gotten. The issue is anything under 8 doesn't work but everything over 12 still does for some reason. /(\d|[a-z]){8,12}/ also tried: (same results) /\d|[a-z]{8,12}/ Anyone know why the 12 isn't registering? // password validator $passpattern = "/(\d|[a-z]){8,12}/"; if(!preg_match($passpattern, $_POST['pass'])) { header("location:add.php?errorcode=5"); die(''); }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.