Looked at 2 other regex related questions and both were vastly beyond what I need help with X'D.
<?php
$userName = trim($_POST['username']);
if(preg_match("/^[a-zA-Z].*(?(\d)).{8,}$/", $userName)){
echo 'woot!';
I'm not really sure why its failing. I know its checking the first character must be alpha, then go more * but check at the end if its a digit ?(\d)... But why wont it check if the length of my $userName is 8 or more?
if I do
... *(?(\d){8,}
Its going to look for 8 or more digits as opposed to if the string itself is 8 or more.
User must: start with letter, only end in numbers, and can only contain alphaNumeric, must be at least characters 8 long, and treat lower and uppercase the same. Which is to say I need to add an i at the end of my regex.
As so there is no way to work it into a regex aside form look aheads? ^...$.{8,}
wouldn't work?