Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 19th, 2008, 05:16 AM
Registered User
 
Join Date: Feb 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to reach_reema
Default Help needed with Regex

Hi all,

I need the regex to allow only a.b or at the max a.b.c as the text in a textbox.I believe the @.com is not necessary.
How do i create the regex to validate the same?

Thnx,
R
 
Old May 20th, 2008, 02:46 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Hi Reema

Not sure you are checking single char or any character word string

^([a-z]([.][a-z]){1,2}$ should do it for a.b or a.b.c

make it as

^(\w([.]\w){1,2}$ for words

Cheers
Shasur


http://www.dotnetdud.blogspot.com

VBA Tips & Tricks (http://www.vbadud.blogspot.com)





Similar Threads
Thread Thread Starter Forum Replies Last Post
regex mrame XSLT 12 July 25th, 2008 09:37 AM
Regex help needed for form validation Lucy Javascript How-To 2 February 1st, 2006 10:47 AM
Regex htran XSLT 2 May 18th, 2005 09:21 AM
Need RegEx help Snib Pro PHP 6 November 16th, 2004 06:59 AM
Regex Help boyer99g General .NET 2 October 8th, 2004 05:46 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.