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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:10:50+00:00 2026-06-13T18:10:50+00:00

I want a regular expression in java to check, if a string contains continuous

  • 0

I want a regular expression in java to check, if a string contains continuous 3 digits. But the problem is my string may contain unicode characters. If the string contains unicode characters it should skip the unicode characters (skip 4 ‘.’s after & AND #) and should do the checking. Some examples are

Neeraj : false
Neeraj123 : true
&#1234Neeraj : false
&#1234Neeraj123 : true
123N&#123D : true
Neeraj&#1234 : false
Neeraj&#12DB123 : true
&#1234 : false
  • 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-13T18:10:51+00:00Added an answer on June 13, 2026 at 6:10 pm

    You need to use a negative lookbehind assertion:

    Pattern regex = Pattern.compile(
        "(?<!             # Make sure there is no...           \n" +
        " &\\#            # &#, followed by                    \n" +
        " [0-9A-F]{0,3}   # zero to three hex digits           \n" +
        ")                # right before the current position. \n" +
        "\\d{3}           # Only then match three digits.", 
        Pattern.COMMENTS);
    

    You can use it as follows:

    Matcher regexMatcher = regex.matcher(subjectString);
    return regexMatcher.find();  // returns True if regex matches, else False
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want a regular expression that contains alpha and numeric characters and must be
I have an regular expression built in Java. String expr = <a.*?id=\(pres.*?)\.*?>Discharge.*?Medications:</a>; I want
In Java's regular expression, I want to match any sentence that contains the word
Hi I want a regular expression (Java) for a string in the following form:
i want a regular expression to validate string to have only text,operators and these
I want a regular expression that validate a string that allow only numbers and
I have a regular expression: ^([a-zA-Z])[a-zA-Z_-]*[\\w_-]*[\\S]$|^([a-zA-Z])[0-9_-]*[\\S]$|^[a-zA-Z]*[\\S]$ (from Java). And I want to add a
what is the pattern to validate the following regular expression in java. string with
I want to capture the index of a particular regular expression in a Java
I want the following regular expression to match URLs containing sub-domains but not match

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.