dojo - ValidationTextBox - "regular expression syntax"

I have to create textboxes in dojo/javascript.

It should validate values. So i am planning to use "dijit/form/ValidationTextBox"

In textbox1(i.e. validationtextbox) , i have to check value should be 1 or 0 and no other values. What should be the  "regular expression syntax"  for it....

In textbox2(i.e. validationtextbox) , i have to check value should be a number. What should be the  "regular expression syntax"  for it....

In textbox3(i.e. validationtextbox) , i have to check length of string should not be more than 200 characters. What should be the  "regular expression syntax"  for it....

pl guide

thanks a lot
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Terry WoodsIT GuruCommented:
I haven't used that tool, but here's some regular expressions that should work:

0 or 1:
Number (unsigned integer):
Number (optionally signed integer):
Number (optionally signed decimal, optional decimal places):
Length <= 200:
Terry WoodsIT GuruCommented:
Looking at this example, you would just need to remove the / characters from my patterns above, something like this:
     <input type="text"
            invalidMessage="You must enter a number">

Open in new window

ts84zsAuthor Commented:
yes on dojo's website its mentioned that "Validationbox regular expression syntax" is exactly similar to "Javascript regular expression syntax"  

So whatever is in javascript, pl guide me... thanks a lot...
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

ts84zsAuthor Commented:
thanks a lot i am looking into your comments
ts84zsAuthor Commented:
those are not working ... pl guide
Terry WoodsIT GuruCommented:
Start with a simple pattern like:
which should only match when only an "a" character has been entered, or even:
which should match when there's an "a" character within a string.

See if you can get that working, and go from there.
ts84zsAuthor Commented:
regExp:'[A-Z,a-z,0-9,_, ,-]{1,254}
works to put in text which can have characters from A-Z, a-z, 0-9, a space, _ , - and which has maximum of 254 characters

How do i put validation for not null... pl guide thanks a lot
Terry WoodsIT GuruCommented:
Using the same syntax as your example:
although that also allows a value that is only a whitespace character such as a space. To require a non-whitespace character:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.