Re: Controlling just size with regular expressions
| From: | Christian Reiniger | Date: | Tue, 10 Apr 2001 10:38:47 +0000 |
| Subject: | Re: Controlling just size with regular expressions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-47993@lists.php.net to get a copy of this message | ||
On Monday 09 April 2001 23:37, you wrote:
> Hi there,
>
> I need a regular expression that accepts *anything* without
> restrictions, only that the size of the string should be between (for
> instance) 0 and 9 characters. I know the {0,9} trick, but how do I
> accept *anything* in a form field?
"anything" = '.'
=> /^.{0,9}$/ will do the trick
strlen () will be faster though
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
AAAAA - American Association Against Acronym Abuse