thx for the link
an example in the link gave me a starting point
CODE
(preg_match('/^[a-z\d_]{6,12}$/i', $username))
this seems to be something more like i require but this is very confusing and trying to disect
just been having a read through some tutorials
^ doesnt this mean the string being searched must start with this pattern. Do i need this for what im trying to achieve?
$ at the end of a regular expression indicates that the string being searched must end with this pattern. Do i need this for what im trying to achieve?
\d think this is short way of writing 0-9 sm i right?
the / im guessin this is where string starts and ends am i right?
{6,12} think this is self explanatory {min legth,max length}
[] this groups the pattern
can anyone tell me what the "i" was in the above code
this seems to be basic principle
CODE
preg_match('pattern', text_to_search);
so heres what i came up with can anyone tell me if this is correct to what i need?
CODE
preg_match('/[a-zA-Z\d]{6,12}/', ($_POST[username]));