Regular Expresion Validator

Posted on 2006-05-30
Last Modified: 2010-05-18
I'm trying to validate a text control in the following format :


This means that the user has to write in the textbox (@ plus any string he wants upto 50 characters.
My first try was this :  [(@_a-zA-Z_0-9_ _áéíóúñÑ]{3,50} but didn't works.
Any help will be appreciate it.
Question by:NeGueSa

    Author Comment

    I allready found out which expression to use is:

    LVL 2

    Accepted Solution


    U r right.

    But when u pass alphanumeric like the followings:

    (@34543ewrewrew  No Matches [0]

    (@ewrewrew34543  Matches [(@ewrewrew]


    ^[(]+[@]+[\w*]{1,50}                    allow alphanumeric

    LVL 3

    Expert Comment

    mbip: that allows all characters: ^[(]+[@]+[A-Z_a-z_0-9]{1,50}
    LVL 2

    Expert Comment

    wht  u want? only text or numeric depends on u.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    When pages do not download correctly, and you don't know why, the first thing you do is to look at the HTML source code of that page, but not all the downloaded files appear always clearly. If your source includes a javascript that computes the name…
    Accessibility and Usability are two concepts that seem to be closely related.  But, too many people seem to have a distorted perception of them. During last five years, those two words have come to the day-to-day work of almost every web develope…
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
    Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now