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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:22:48+00:00 2026-06-14T20:22:48+00:00

Is there any regex (!) which can test if a string contains 3 digits

  • 0

Is there any regex (!) which can test if a string contains 3 digits ( never-mind the order) ?

(at least 3 digits. also I be happy to see the exact 3 solution.( if you’re kind ))

example :

abk2d5k6 //3 digits
abk25k6d //same here //3 digits

my fail tries :

.+?(?=\d){3}

Thanks.

(only regex solutions please , for learning purpose.).

  • 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-14T20:22:50+00:00Added an answer on June 14, 2026 at 8:22 pm

    Well, for the learning purpose, I suggest to read through this very comprehensive tutorial.

    Otherwise, the JavaScript regex would probably look something like this:

    if you want to make sure that there are at least three digits:

    /^(?:\D*\d){3}/
    

    Or if you want to make sure that there are exactly three digits:

    /^(?:\D*\d){3}\D*$/
    

    \D is any non-digit character. * allows 0 or more of those. \d is any digit character. {3} repeats the subpattern 3 times. And ^ and $ mark the start and end of the string, respectively.

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

Sidebar

Related Questions

Is there any regex I can use to match blocks of exactly 10 digits?
Is there any way to handle the exception if regex.Matches didn't match anything and
Is there any way to have this: [one[two]][three] And extract this with a regex?
Is there any way I can use RegExp or Wildcard searches to quickly delete
Is there any way I can set a formatter on models that will convert
There are some features in modern regex engines which allow you to match languages
I've got a string that contains multiple substrings, each of which contains one or
Is there any application for a regex split() operation that could not be performed
My regex is /a .*programming .*test .*this/i and test string is This is a
I have a string which can include none, one or two values. In case

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.