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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:21:45+00:00 2026-06-11T11:21:45+00:00

I have to write Regex in Java according to the following conditions: total digit

  • 0

I have to write Regex in Java according to the following conditions:

  • total digit character limit = 64
  • a single digit of 0 is acceptable
  • first digit must be 1 through 9 if more than one digit
  • following digits can be 0 through 9
  • two digits are allowed after a decimal point
  • comma’s are not accepted

so far I have only got this:

(\\d{1,64})

Can someone help me

  • 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-11T11:21:46+00:00Added an answer on June 11, 2026 at 11:21 am
    Pattern regex = Pattern.compile(
        "^             # Start of string                 \n" +
        "(?!.{65})     # Assert length not 65 or greater \n" +
        "(?:           # Match either                    \n" +
        " 0            #  0                              \n" +
        "|             # or                              \n" +
        " [1-9]\\d*    #  1-n, no leading zeroes         \n" +
        ")             # End of alternation              \n" +
        "(?:           # Match...                        \n" +
        " \\.          #  a dot                          \n" +
        " \\d{2}       #  followed by exactly 2 digits   \n" +
        ")?            # ...optionally                   \n" +
        "$             # End of string", 
        Pattern.COMMENTS);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following Java regex, which I didn't write and I am trying
I have been trying to write a regex that will remove whitespace following a
Have to write a Regex that will match following: <a href=../../_asp/link.asp?link=sp1234.htm and <a href=../../_asp/link.asp?link=AL432123.htm
I have a string of this format 1.0.x.0 I have to write a regex
In a LaTeX report I am making I have to write a regex. There
I have a Bug at my simple REGEX. I have been trying to write
I have a line like this : EQ=ENABLED,QLPUB=50,EPRE=ENABLED,T200=44-31-41-90-90-90-135 with java Regex ,I want to
I have a requirement to write a regex to validate a text entry. The
can someone write a regex in C# for me to verify the following emails
I was trying to write an regex that allows single hyphens and single spaces

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.