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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:02:51+00:00 2026-06-16T07:02:51+00:00

Possible Duplicate: Regex for floating point? I am trying to use the regex. The

  • 0

Possible Duplicate:
Regex for floating point?

I am trying to use the regex.

The valid strings are:

1

11

5

12222222233

1.2

.5

1222.33444

12234.456

0

Invalid Strings are

.

-2

san

2s2

S2S

ssss2ssss

25535535TY

But this regex does not qualify to test multiple dots (.)
such as

1……5,

5..2233

1223…5

This accepts these values as valid string.
Please help me how to fix this issue with reg.

Note, the above validation should be passed.

  • 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-16T07:02:52+00:00Added an answer on June 16, 2026 at 7:02 am

    How about that regex: \d*(\.\d+)?

    EDIT

    This regex \d*(\.\d+)? will allow empty values too.

    The updated version: \d*(\.)?\d+ does not have that issue.

    Please note that negative values will not be allowed as \d matches only digits 0..9

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

Sidebar

Related Questions

Possible Duplicate: Regex question mark I am trying to figure out how to parse
Possible Duplicate: Regex to conditionally replace Twitter hashtags with hyperlinks I'm trying to get
Possible Duplicate: Linkify Regex Function PHP Daring Fireball Method I'm trying to get URLs
Possible Duplicate: Regex Testing Tools What sorts of tools do other programmers use when
Possible Duplicate: RegEx match open tags except XHTML self-contained tags I am trying to
Possible Duplicate: C# Regex: Checking for a-z and A-Z I could just use the
Possible Duplicate: Regex for checking if a string has mismatched parentheses? I'm trying to
Possible Duplicate: Regex URL Match im trying to create functions that will give my
Possible Duplicate: Regex / Preg: No match, if found I want to use preg_replace
Possible Duplicate: RegEx match open tags except XHTML self-contained tags Lets say I'm trying

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.