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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:16:48+00:00 2026-06-12T01:16:48+00:00

I’ve not been using regex very long, and I’m struggling with defining the right

  • 0

I’ve not been using regex very long, and I’m struggling with defining the right regex pattern. I’ve searched this site and many others not quite finding what I need.

Here’s the sub-string from a file I need to parse:

    As of 10 AM on:
    9/7/2012         227,134 mmcf.
    9/9/2011         1,224,376 mmcf.
    9/10/2010        424 mmcf.

What I need to extract is any number that is not a date from a line(s) inside the file. Each of the lines in the example above are newlines in the file, with the date being the first word in the line (as you’d probably expect). The whitespace following the date is actually two tabs and a single space. I need to extract the value 227,134 only, and I need to be able to grab that value for any number 1 – 999,999,999. As you can see, the commas are included in the value.

I’ve been able to create a pattern that matches any of the values (123,456; 123,224,376; and 424), but it also matches each of the date properties (month, day, year). I have a pattern that grabs the date & white space, but I’m not sure how to grab the value after that.

Here is the current pattern I am using:

    ^(?:3[01]|[12][0-9]|[1-9])[/.-](?:1[0-2]|[1-9])[/.-][0-9]{4}         [,0-9]+\b

This matches the following:

    9/7/2012         227,134
    9/9/2011         1,224,376
    9/10/2010        424

Is there a way to match part of a pattern and exclude it from the remainder of the pattern?

What is the best approach for this?

I’m really only concerned with finding the first value (in this case, 227,134) in the list.

Thanks in advance for your help.

  • 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-12T01:16:50+00:00Added an answer on June 12, 2026 at 1:16 am
    [\d\,]+(?=\smmcf\.)
    

    One or more digits or commas, followed by a space and “mmcf.”

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
For some reason, after submitting a string like this Jack’s Spindle from a text
I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into

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.