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

  • Home
  • SEARCH
  • 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 9272031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:46:04+00:00 2026-06-18T15:46:04+00:00

This is for validating usernames on my system. Every username can include these symbols

  • 0

This is for validating usernames on my system.

Every username can include these symbols “.-_”, but the words separated by the mentioned symbols cannot be digits only.

An example would be

Invalid:

123.as-as123
123.AS-aS123

Valid:

a123.as-as123
A123.AS-aS123
  • 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-18T15:46:05+00:00Added an answer on June 18, 2026 at 3:46 pm

    I believe this will work, if I understand your requirements correctly:

    /^(?:[a-z0-9]*[a-z][a-z0-9]*[.\-_])*[a-z0-9]*[a-z][a-z0-9]*$/i
    

    It matches zero or more groups of letters/numbers ending with .,-, or _ and requiring at least one letter. Then it matches a final group of letters/numbers, requiring at least one letter.

    It is case insensitive (that is what the i at the end does), so it will match uppercase as well. (This syntax works at least in Perl and PHP. In other languages, you might have to apply this option in a slightly different way, but case insensitive is always available).

    One might be tempted to shorten it like this:

    /^(?:[a-z0-9]*[a-z][a-z0-9]*[.\-_]?)+$/i
    

    However, that is less desirable, because making the [.\-_] optional gives it too much flexibility in the ways it can try to match. It will probably have to run through a huge number of cases on a pattern that fails.

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

Sidebar

Related Questions

I can't see a clear mistake in this code. Instead of validating my fields,
how is this jquery app validating the username? (3rd party script) Iam using the
I use the django.auth system and I've this: class RegisterForm(UserCreationForm): username = forms.RegexField(label= Username
I have this custom validation attribute for validating a collection. I need to adapt
I'm validating a textbox for valid email with this: <asp:RegularExpressionValidator ID=RegularExpressionValidator1 ControlToValidate=txtMailCustom Text=Invalid address
i use this javascript syntax for validating a checkbox... alert(document.getElementById(ctl00_ContentPlaceHolder1_Chkreg).checked); if (document.getElementById(ctl00_ContentPlaceHolder1_Chkreg).checked == false)
I have got a php login system but it lacks to features. I would
I'm working on authorization system for Kohana. I'm doing it just for education... This
I am stuck at this error and can not find the solution to this.
I've done some searching online and can't seem to figure this out. How do

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.