Yes it is something like this I was looking for. But unfortunately this definition is not working for me. I am usning in Perl and Javascript combined.
For eg: I have a variable "name"(It is not for person's name it is something else,anyway) the pattern defined as :-
semiote_hash["name"] = "[[A_Z]{1}+[a-z]*$]::g";
so when the user enters the value for this field it is checked against this predefined pattern and if it doesn't match then it is displayed to the user asking him/her to change the value. These are defined in a javascript file and when the user submits it loads the cgi files and does the rest of the work.
Hey wizkid, the above one is the one you suggested but that too is not working. But thanks for the reply