WODA: FAQs

 Basic Setup

How do I limit the maximum characters in a field?
I thought that $WBF{$x} = 'm/([A-Za-z\-\. ]){1,40}/'; is for "max 40, min 1
characters", but it doesn;t seems to limit it!

--------------------------
The problem is that regular expressions are usually greedy.
What you did will work ANY number of chars.
what you want is (notice ^ for start and $ for end):

$WBF{$x} = 'm/^[ A-Za-z\-\.]{1,40}$/';


Good luck,
Jean-Paul
modify the informationdelete entire recordexplain the meaning of the fieldsbrowse recordsAdd a new questionHome page of this databaselogin Valid HTML 4.01 Transitional Valid CSS! Powered by WODA 4.6x trunk