473,387 Members | 1,700 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,387 software developers and data experts.

help with validating a textbox

hey all,

i'm trying to validate a textbox on my form with the following expression:
0.a.0.a

meaning I need to make sure the user follows this pattern.
0-9
period
A-Z
period
0-9
period
a-z

can someone direct me to a good reference article because i can't find
anything basic with regular expressions in msdn help so far.

thanks,
rodchar
Nov 19 '05 #1
3 842
Try here:- http://www.regexlib.com/
It should help
Patrick
*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #2
Thankfully, you have mostly described the expression. It is:

^\d\.[A-Za-z]\.\d\.[A-Za-z]$

^ and $ force the text to be the entire text
\d = all digits
\. = period
[A-Za-z] = set of upper and lowercase letters.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:31**********************************@microsof t.com...
hey all,

i'm trying to validate a textbox on my form with the following expression:
0.a.0.a

meaning I need to make sure the user follows this pattern.
0-9
period
A-Z
period
0-9
period
a-z

can someone direct me to a good reference article because i can't find
anything basic with regular expressions in msdn help so far.

thanks,
rodchar

Nov 19 '05 #3
thank you very much.

"Peter Blum" wrote:
Thankfully, you have mostly described the expression. It is:

^\d\.[A-Za-z]\.\d\.[A-Za-z]$

^ and $ force the text to be the entire text
\d = all digits
\. = period
[A-Za-z] = set of upper and lowercase letters.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:31**********************************@microsof t.com...
hey all,

i'm trying to validate a textbox on my form with the following expression:
0.a.0.a

meaning I need to make sure the user follows this pattern.
0-9
period
A-Z
period
0-9
period
a-z

can someone direct me to a good reference article because i can't find
anything basic with regular expressions in msdn help so far.

thanks,
rodchar


Nov 19 '05 #4

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

Similar topics

6
by: Alex Bink | last post by:
Hi, I have a validating event on a textbox in which I want to prevent the user to leave the textbox without entering the right data. Only if he clicks on another specific control he is allowed...
2
by: dzemo | last post by:
Hi I created windows user contorl and added reference to other project. Control contains TextBox and PictureBox. How to handle some event of textbox (validating for example) of user control in...
2
by: Chris Dunaway | last post by:
I have a form with a textbox and numerous panels, buttons and other controls. I have handled the textbox Validating and Validated events. The textbox will hold a filename. In the validating...
0
by: Matthew | last post by:
All, I have searched google and the newsgroups but can't find anything the same as what I am experiencing (though I may have missed something). I have controls (textboxes) within UserControls...
0
by: Gary Shell | last post by:
I am experiencing some strange behavior between a UserControl's validating event and a treeview control. Initially, I thought it was related to an issue in the Knowledgebase article 810852...
7
by: Bruce HS | last post by:
I'd like to call my ancestor Validation Function every time any control on a Win Form generates a Validating or Validated event. I'm using VB. I've extended Textbox, for instance, to have its...
5
by: ameen.abdullah | last post by:
Hi Guys, I have a textbox in windows form that should only accept alphabets, numbers, spaces and underscore. If the textbox contains anyother character it should display a msg at the time of...
3
by: TheSteph | last post by:
Hi Experts ! I have a Winform Program in C# / .NET 2.0 I would like to ensure that a value in a TextBox is a valid Int32 when user get out of it (TextBox loose focus)
1
by: =?Utf-8?B?bGpsZXZlbmQy?= | last post by:
I've noticed that controls do not raise a Validating event if they are contained in a ToolStripDropDown via a ToolStripControlHost item. Please run the following sample and follow the instructions...
8
by: Peted | last post by:
I have an amazing problem which i think i have no hope of solving Im working with a c# dot net module that is hosted by and runs under a delphi form envrioment. Dont ask me how this insanity has...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.