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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:14:46+00:00 2026-05-27T04:14:46+00:00

Well my question is simple, I want to match a string with following attributes

  • 0

Well my question is simple, I want to match a string with following attributes

  • No white space
  • Must start with a letter
  • Must not contain any other special characters other than underscore
  • May contain numbers

Please help in creating such a 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-27T04:14:46+00:00Added an answer on May 27, 2026 at 4:14 am
    ^[a-zA-Z][a-zA-Z0-9_]*$
    

    Dissecting it:

    • ^ start of line/string
    • [a-zA-Z] starts with a letter
    • [a-zA-Z0-9_]* followed by zero or more letters, underscores or digits.
    • $ end of line/string

    If you need to consider Unicode, then the following is probably more sane:

    ^\p{L}[\p{L}\p{Nd}_]*$
    

    This will match not only ASCII letters and digits but across all scripts that are supported by Unicode. Digits are restricted to decimal digits, only, so you won’t get Roman numerals.

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

Sidebar

Related Questions

Well this is a simple question i want to filter two elements sorted reverse
Simple question... quite possibly not simple answers :) I want to write an accessibility
Well, simple question. I'm working with VS2008 on an ASP.NET web application which has
Well, question is simple. Hot to achieve that my canvas(i.e. resolution 15000 * 10000
Well, I have a simple question, at least I hope its simple. I was
Well looks too simple a question to be asked but i asked after going
Well, the question is kinda simple. I have a object defined as: public class
Sorry this is not a very well defined question, I am thinking about an
It's a simple question about regular expressions, but I'm not finding the answer. I
I got a really simple question. string str; cin >> str; cout << str;

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.