note 97797 deleted from function.preg-match by degeberg

From: Date: Tue, 11 May 2010 13:36:37 +0000
Subject: note 97797 deleted from function.preg-match by degeberg
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-169142@lists.php.net to get a copy of this message
Note Submitter: Anonymous ---- 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 or . 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. Valid results would be: a ab ab.c invalid would be: . .a .abc ab.c. a. Any clues of how to do this? Regards...

« previous php.notes (#169142) next »