note 97796 added to function.preg-match

From: Date: Sun, 09 May 2010 01:28:55 +0000
Subject: note 97796 added to function.preg-match
Groups: php.notes 
Request: Send a blank email to php-notes+get-169081@lists.php.net to get a copy of this message
There is one case I can't figure out how to solve. Look at this expression: ^[^.][a-z]+[^.]$ It says that the first AND last position shall not be a . character and in between the first and last there can be any number of a-z. But this requires minimum 3 characters to pass. What I want is that first and last position must be 0 or 1 character not containing the . character. This makes it possible to let only one character of a-z to pass. Any clues of how to do this? Regards... ---- Server IP: 80.67.10.226 Probable Submitter: 85.195.21.122 ---- Manual Page -- http://www.php.net/manual/en/function.preg-match.php Edit -- https://master.php.net/note/edit/97796 Del: integrated -- https://master.php.net/note/delete/97796/integrated Del: useless -- https://master.php.net/note/delete/97796/useless Del: bad code -- https://master.php.net/note/delete/97796/bad+code Del: spam -- https://master.php.net/note/delete/97796/spam Del: non-english -- https://master.php.net/note/delete/97796/non-english Del: in docs -- https://master.php.net/note/delete/97796/in+docs Del: other reasons-- https://master.php.net/note/delete/97796 Reject -- https://master.php.net/note/reject/97796 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#169081) next »