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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:34:11+00:00 2026-05-26T19:34:11+00:00

Can someone help me to match the pattern? I need to get numbers out

  • 0

Can someone help me to match the pattern? I need to get numbers out of this string

TASK REMAINING TOTAL changed from [0.0] to [1.5], TASK ESTIMATE TOTAL changed from [0.0] to [5.0], PLAN ESTIMATE added [5.0 Points]

I need to get exactly the numbers after TASK ESTIMATE TOTAL. So, it should be in regex, but not in the match.

  • 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-26T19:34:11+00:00Added an answer on May 26, 2026 at 7:34 pm

    This regex would get the numbers for you:

    /\[(\d+(?:\.\d+)?)\]/
    
    1. Finds an opening bracket
    2. Captures 1 or more digits
    3. If there’s a dot it must be followed by 1 or more digits and captures this aswell
    4. Finds the closing brackets

    Update:

    TASK ESTIMATE TOTAL changed from \[(\d+(?:\.\d+)?)\] to \[(\d+(?:\.\d+)?)\]
    

    The first number will be stored in group1 and the second in group2.

    s = "TASK REMAINING TOTAL changed from [0.0] to [1.5], TASK ESTIMATE TOTAL changed from [0.0] to [5.0], PLAN ESTIMATE added [5.0 Points]"
    pattern = /TASK ESTIMATE TOTAL changed from \[(\d+(?:\.\d+)?)\] to \[(\d+(?:\.\d+)?)\]/
    
    if s =~ pattern
       print "value1 = ", $1, ", value2 = ", $2
    end
    

    Output:

    value1 = 0.0, value2 = 5.0
    

    See it in action here: http://codepad.org/mYARv7Zr

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

Sidebar

Related Questions

I need to do a non greedy match and hope someone can help me.
Using javascript, can someone please help me with a pattern to match something in
Can someone help me to correct that? match 'graphs/(:id(/:action))' => 'graphs#(:action)', :via => [:get,
I am hoping someone can help me come up with a pattern to get
Can someone help me with a Javascript regular expression? I need to match pairs
Can someone help me identify what the purpose of this unidentified syntax is. It
Can someone help me figure out the following make file? BINS=file1 file2 file3 all:
Can someone help me with this: This is a program to find all the
Can someone help me create an index/count button for a UITableView, like this one?
Can someone maybe help me with this regex? I am using Javascript and classic

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.