473,386 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Regular Expression Validation - spaces problem

Hi

I'm using a regular expression validator, but if spaces are entered,
it bypasses the validation!

I'm using

^[0-9a-zA-Z]{5,100}$

[alpha-numeric characters between 5-100 in length.]

I was using a required filed validator beforehand, which wouldn't let
you get waay with spaces.

Can anyone advise?

Thanks

NJ
Nov 17 '05 #1
2 2237
Field validators only fire when there is content in the field being
validated. To check that a field has data, and correct date, you need to
use two validators. The required field validator will ensure that data is
entered, and your second validator (eg. regular expression validator) will
ensure that the data entered is in the required format.

Hope this helps,

Mun


"Nazir" <na***********@yahoo.co.uk> wrote in message
news:9e************************@posting.google.com ...
Hi

I'm using a regular expression validator, but if spaces are entered,
it bypasses the validation!

I'm using

^[0-9a-zA-Z]{5,100}$

[alpha-numeric characters between 5-100 in length.]

I was using a required filed validator beforehand, which wouldn't let
you get waay with spaces.

Can anyone advise?

Thanks

NJ

Nov 17 '05 #2
Thanks Mun - that did the trick.

NH
"Munsifali Rashid" <mun@**RemoveToReply**vefuk.com> wrote in message news:<eH**************@TK2MSFTNGP09.phx.gbl>...
Field validators only fire when there is content in the field being
validated. To check that a field has data, and correct date, you need to
use two validators. The required field validator will ensure that data is
entered, and your second validator (eg. regular expression validator) will
ensure that the data entered is in the required format.

Hope this helps,

Mun

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Bryce Budd | last post by:
Hi all, I am trying to use a regular expression validator to check for the existence of PO Box in an address textbox. The business rule is "No addresses with PO Boxes are allowed." What I...
9
by: Stirling | last post by:
Hi all, hope someone can help me, I am looking to do a password validation check using client side validation. Minimum requirement is that it must contain at least one number and one letter. ...
18
by: Q. John Chen | last post by:
I have Vidation Controls First One: Simple exluce certain special characters: say no a or b or c in the string: * Second One: I required date be entered in "MM/DD/YYYY" format: //+4 How...
5
by: John | last post by:
I am new in Regular Expression. Could someone please help me in following expression? 1. the string cannot be empty 2. the string can only contains AlphaNumeric characters. No space or any...
3
by: James D. Marshall | last post by:
The issue at hand, I believe is my comprehension of using regular expression, specially to assist in replacing the expression with other text. using regular expression (\s*) my understanding is...
25
by: Mike | last post by:
I have a regular expression (^(.+)(?=\s*).*\1 ) that results in matches. I would like to get what the actual regular expression is. In other words, when I apply ^(.+)(?=\s*).*\1 to " HEART...
6
by: billsahiker | last post by:
I cannot get anything to validate a comma delimited list of stock symbols, like "IBM, MSFT,INTC). symbols are alphanumeric with a maxium length of 5. I want to block multiple, adjacent commas, and...
4
by: sreemati | last post by:
Hi, I have seen various online resources and tuturials. I ahve written a piece of code but it does not seem to work Problem defined: If not number entered (as not mandartory) ignore ...
4
by: carlos | last post by:
I am working on a regular expression validation for my search page. What I have so far works for most cases, but I would like to fine tune it some. I am new to regular expressions, and I do not...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.