Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8789569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:26:42+00:00 2026-06-13T22:26:42+00:00

There is a long set of characters that are not allowed to validate an

  • 0

There is a long set of characters that are not allowed to validate an input box of winform app.

So i figured that rather than making the long list that are not allowed make the shorter one that are allowed.

The set that is allowed are (a-z,A-Z, 0-9,@,.) .Rest every thing that can be entered are not allowed.

This is the regex that i have made for this.

Regex.IsMatch(textBox1.Text, @"[@\.\w]+$")

It seem to work in some cases but when i enter the data in this format normal character or number special character normal character or number it seems to break few example ee(vv, 55)44,aba&3B.

Not able to figure out whats wrong in this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T22:26:44+00:00Added an answer on June 13, 2026 at 10:26 pm

    Your regex is not valid, because you don’t validate all string, but the last part.
    You should start it with ^ – beginning of the line symbol.

    Regex.IsMatch(textBox1.Text, @"^[\w@.]*$")
    

    \w also means letters in every language, so it will validate the string "абц" too.
    So if you need only for english, use

    Regex.IsMatch(textBox1.Text, @"^[a-zA-Z0-9@.]*$")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is there any way to convert durtion of MediaPlayer that is in long to
When you have a LPCWSTR, why is it a Long Pointer? There's no Long
There are strings in a long text as: <fn id=T1FN1> anytext <p> sometext </p>
There's a ListBox with some long items. These long items are getting beyond the
Is there any way to stop or terminate long running Oracle query in JDBC
Are there any good technical solutions for extremely long term archiving of data, for
Is there some plan or estimate about how long will Rails 2 be supported
Is there a way to get a report of how long each test is
Is there a way to get the status how long does it takes to
Is there a standard linux/unix pattern for communicating with long running process? For example,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.