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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:32:34+00:00 2026-06-13T19:32:34+00:00

I need a RegEx that fulfills this statement: There is at least one character

  • 0

I need a RegEx that fulfills this statement:

There is at least one character and one digit, regardless of order, and there is no suffix (i.e. domain name) at the end.

So I have this test list:

ra182
jas182
ra1z4

And I have this RegEx:

[a-z]+[0-9]+$

It’s matching the first two fully, but it’s only matching the z4 in the last one. Though it makes sense to me why it’s only matching that piece of the last entry, I need a little help getting this the rest of the way.

  • 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-13T19:32:35+00:00Added an answer on June 13, 2026 at 7:32 pm

    You can check the first two conditions with lookaheads:

    /^(?=.*[a-z])(?=.*[0-9])/i
    

    … and if the third one is just about the absence of ., it’s simple to check too:

    /^(?=.*[a-z])(?=.*[0-9])[^.]+$/i
    

    But I’d probably prefer to use three separate tests instead: with first check for symbols (are you sure it’s enough to check just for a range – [a-z] – and not for a Unicode Letter property?), the second for digits, and the final one for this pesky dot, like this:

    if (Regex.IsMatch(string, "[a-zA-Z]") 
        && Regex.IsMatch(string, "[0-9]")
        && ! Regex.IsMatch(string, @"\.") ) 
    { 
        // string IS valid, proceed
    }
    

    The regex in the question will try to match one or more symbols, followed by one or more digits; it obviously will fail for the strings like 9a.

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

Sidebar

Related Questions

I need regex that will match this Fred, Jhon, Tree, and there could be
I need a Regex that matches all instances of any character that is not
OK, I need a RegEx that traps the first word up to underscore character
I need a regex that will ensure the the user input looks like this
I need a regex that matches this kind of strings: brand-new-car brand-new-car-1 brand-new-car-100 307
i need a regex that converts commas to spaces. I know this is super
I need a regex that would validate first 4 digit set and then 3
I need a regex that will determine if a given SQL statement has a
I need a RegEx that can handle an integer between 1 - 999 or
I need a regex that also matches Chinese, Greek, Russian, ... letters. What I

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.