Code example. #^[a-z0-9-]+\.[a-z0-9-\.]{2,8}$#si PHP: may i know what does the {2,8} $ means and what does the si means? Help appreciated alot if anyone can explain the expression in layman terms.. thanks in advance
{2,8} means 2 to 8 of preceding characters $ means end of string More info on regex syntax at http://www.sitepoint.com/article/regular-expressions-php/2 (scroll down half the page)
si are modifiers for the pattern s means a . (dot) will match new lines i means the pattern is case-insensitive
can someone help me see if my reg expression is correct.. ^([a-zA-z\-]{3,*})+$ PHP: i want to allow only letters and dash(-). and minimum 3 characters.. this is what i come out with.. is it correct?
hi, i found out some problem with the code i use above. The letters and dash are correct, but the min 3 characters seem wrong, i couldn't figure that out. any advice or light appreciated.
I have not found solution with regexp to limit the length, BUT, you want the input to be letters and dash AND minimum length is 3, so i have other solution $input = 'something'; if (preg_match('/^([a-z\-]+)+$/i', $input) && strlen($input) >=3) { echo('good'); } PHP:
hi, what is the regular expression to allow whitespace is it ^([a-zA-z\-\s]{3,})+$ Code (markup): ??? is whitespace \s?