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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:43:13+00:00 2026-05-15T12:43:13+00:00

what the regular expression of a line of string containing ONLY float numbers separated

  • 0

what the regular expression of a line of string containing ONLY float numbers separated with spaces or tabs. The float number can be negative, like -999.999

  • 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-15T12:43:13+00:00Added an answer on May 15, 2026 at 12:43 pm

    Let’s come up with a regex for a float, and then see what we can do about the rest.

    A float is:

    • An optional negative sign
    • Followed by a number of digits
    • Followed by an optional decimal point and then more digits
    • Followed be “e”
    • Followed by a number of digits (with an optional sign).

    Put that together, and we get:

    /-?[0-9]+(\.[0-9]+)?([Ee][+-]?[0-9]+)?/
    

    Now, this is pretty loose, but you can tweak it if you want to tighten it up a little. Now, for any number of these with spaces in between, it’s pretty trivial:

    /^(F\s+)+$/
    

    Put it all together, we end up with:

    /^(-?[0-9]+(\.[0-9]+)?([Ee][+-]?[0-9]+)?\s+)+$/
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What regular expression can I use (if any) to validate that a given string
I have a regular expression, defined in a verbatim C# string type, like so:
I have a regular expression that parses a line# string from a log. That
Why is my regular expression adding am line break before the closing tag? string
Need to parse a Class declaration line in Java using regular expression e.g. String
i'm searching for keywords in a string via a regular expression. It works fine
I am trying to use the following regular expression to check whether a string
Given a string, I want to use a regular expression to tokenize it. The
When I try to validate XML file with a XSD schema containing regular expression,
I have multiple line string that I'd like to replace, but don't understand why

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.