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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:45:25+00:00 2026-05-23T03:45:25+00:00

to search a single char in RegEx is easy. exp: at least one digit:

  • 0

to search a single char in RegEx is easy.

exp: at least one digit:

\d

so i need to match at least 2 digit in the text

.*\d{2}.* or .*\d\d.* #### "d2dr5" -> not match... d22r or d00r match..

will not work because RegEx engine look for these numbers as consecutive how can I search for overall? for example

I want to match at least 3 digit and 2 uppercase word in the text. and the text length can be max 12. how can I do this ? If you can give an explained example so then i may have a point to re-search

example match:

a9r2lDpDf2 – matches. at least 3 digit 2 upper case and not exceeding 12 char in total.

  • 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-23T03:45:25+00:00Added an answer on May 23, 2026 at 3:45 am

    If you want to make sure there is only three digits in the string you can try this (add start and end of string if needed):

    [^\d]*\d[^\d]*\d[^\d]*\d[^\d]*
    

    [^\d]* – anything except digits.

    Same pattern can be used to check for uppercase letters:

    [^A-Z]*[A-Z][^A-Z]*[A-Z][^A-Z]*
    

    RegEx is not the best tool to check length. The language you use has something like length(str) or str.length or str.length() etc.

    It can be done with lookahead feature. This is how RegEx looks in Perl (and it does what you ask):

    /^(?=.*\d.*\d.*\d)(?=.*[A-Z].*[A-Z]).{12}$/
    

    (?=.*\d.*\d.*\d) – “looks ahead” to see if there are 3 digits

    (?=.*[A-Z].*[A-Z]) – “looks ahead” to see if there are 2 uppercase letters

    .{12} – length must be precisely 12 characters. Any character 12 times.

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

Sidebar

Related Questions

We're letting users search a database from a single text input and I'm having
I implemented an as-you-type-searching (text search on single attribute) by fetching with performFetch: after
I have a form which has a search feature - a single text field
Does jqGrid just have any callback after single field search? The onSearch callback fires
I have a timestamp and I want to search for a single date but
i have a single textbox named Keywords. User can enter multiple strings for search.
I am useing searchlogic to search some paintings. Each painting belong to a single
I'm trying to search multiple fields (zc_city, zc_zip and zc_state), matching against a single
How do I get the index of a single word (represents in a char
I have a situation where I would like to search a single word .

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.