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 1029423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:32:31+00:00 2026-05-16T12:32:31+00:00

Similar to this topic . I am trying to validate a username with the

  • 0

Similar to this topic.

I am trying to validate a username with the following restrictions:

  • Must start with a letter or number
  • Must be 3 to 15 characters in length
  • Symbols include: . – _ ( ) [ ]
  • Symbols cannot be adjacent, but letters and numbers can

Edit:

  • Letters and numbers are a-z A-Z 0-9

Been stumped for a while. I’m new to regex.

  • 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-05-16T12:32:32+00:00Added an answer on May 16, 2026 at 12:32 pm

    It is not so clean to express a set of unrelated rules in a single regular expression, but it can be done by using lookaround assertions (Rubular):

    @"^(?=[A-Za-z0-9])(?!.*[._()\[\]-]{2})[A-Za-z0-9._()\[\]-]{3,15}$"
    

    Explanation:

    (?=[A-Za-z0-9])            Must start with a letter or number
    (?!.*[._()\[\]-]{2})       Cannot contain two consecutive symbols
    [A-Za-z0-9._()\[\]-]{3,15} Must consist of between 3 to 15 allowed characters
    

    You might want to consider if this would be easier to read and more maintable as a list of simpler regular expressions, all of which must validate successfully, or else write it in ordinary C# code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that there's a very similar topic for this question, however I'm trying
My question is very similar to this topic . I'm trying to use jquery,
I realize there are similar questions on this topic, but I still cannot find
I've already read through the similar questions on this topic, but none of them
This topic can look similar to others but I haven't found any usable answer
There are similar questions out there on this topic, such as When can I
I didn't see any similar questions asked on this topic, and I had to
Similar to this question , after running the following code the browser dialog does
first time poster. Please be gentle. This topic may be similar to several other
I'm trying to create a game similar to this (Note:When you click 'play', there

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.