469,645 Members | 1,127 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

regex validate field; allowed is empty, null or one word max 30 ch

Jan
Hi all,

I have got the following problem:
User fills in excel sheet, this is loaded in Acces.
After this I run a validation tool to validate the field formats.

One fields is allowed to be null, empty (length = 0) and max 30 chars.
I use the following expression: ^.{0,30}\b

It seems that this is not working as I would expect when fields are empty or
""...

Any ideas...?

Cheers
Nov 17 '05 #1
2 1728
try ^.{0,30}$ ($ instead of \b}.

but why don't you use the length property ?

"Jan" <Ja*@discussions.microsoft.com> a écrit dans le message de
news:EF**********************************@microsof t.com...
Hi all,

I have got the following problem:
User fills in excel sheet, this is loaded in Acces.
After this I run a validation tool to validate the field formats.

One fields is allowed to be null, empty (length = 0) and max 30 chars.
I use the following expression: ^.{0,30}\b

It seems that this is not working as I would expect when fields are empty or ""...

Any ideas...?

Cheers

Nov 17 '05 #2
Jan
Ludovic,

There are also other fields that needs to be validated.
All validation rules are stored in a table as well.
I decided to do all validations the same way: using regex...

I know your solution, checking the length, is also possible.
But it shouldn't be that hard to define this using regex....

"Ludovic SOEUR" wrote:
try ^.{0,30}$ ($ instead of \b}.

but why don't you use the length property ?

"Jan" <Ja*@discussions.microsoft.com> a écrit dans le message de
news:EF**********************************@microsof t.com...
Hi all,

I have got the following problem:
User fills in excel sheet, this is loaded in Acces.
After this I run a validation tool to validate the field formats.

One fields is allowed to be null, empty (length = 0) and max 30 chars.
I use the following expression: ^.{0,30}\b

It seems that this is not working as I would expect when fields are empty

or
""...

Any ideas...?

Cheers


Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.