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

  • Home
  • SEARCH
  • 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 7026869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:10:26+00:00 2026-05-28T00:10:26+00:00

this is my first question. This has stumped me for 2 days. I have

  • 0

this is my first question. This has stumped me for 2 days. I have a list of items, and I need to grab all matches that contain this pattern MM/DD/YYYY … http://www.someurl.com. I am using jquery and here is what I have now. It is alerting only once when I am expecting it to alert 3 times.

$('#news').parent().find('td').children('span.srNewsBlurb').each(function() {
    var html = $(this).html();
    if(/(0?[1-9]|1[012])\/(0?[1-9]|[12][0-9]|3[01])\/(.*http.*)/i.test(html)){ 
        alert('this works');
    }
});

here is the content…

Toys R Us Open Through Christmas Eve (68%)
01/05/2012 – NEW YORK (http://www.thestreet.com/story/11353279/1/toys-r-us-open-through-christmas-eve.html) — It’s time to squeeze in more midnight shopping. similar results
Jeanine Skowronski

Cities Adding the Most Jobs in 2011 (68%)
01/05/2012 – NEW YORK (http://www.thestreet.com/story/11351046/1/cities-adding-the-most-jobs-in-2011.html) — Much of the country is still waiting for the economic recovery to lift the local job market, but in San Antonio it’s as though the recession never similar results
Seth Fiegerman

Congress’ Approval Rating Hits All-Time Low (68%)
01/05/2012- NEW YORK (http://www.thestreet.com/story/11353209/1/congress-approval-rating-hits-all-time-low.html) — Just when it seemed it couldn’t get any worse, Congress’ approval ratings have hit a new low. similar results
Seth Fiegerman

  • 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-28T00:10:27+00:00Added an answer on May 28, 2026 at 12:10 am

    I would engage in a little code reorg: The find/children construct is extremely awkward, and I would re-label my HTML to not require wandering around the parent structure. That said, I suspect your problem is one of those fundamental issues with RegExp, because this worked for me:

    var matcher = /(0?\d|1[012])\/(0?\d|[12]\d|3[01])((.|\s)*)/i;
    $('#news').parent().find('td').children('span.srNewsBlurb').each(function(i,o) {
        rg = matcher.exec($(o).html())
        if (rg) {
            console.log(rg[1], rg[2], rg[3])
        }
    });
    

    See that ((.|\s)*) construct toward the end of the regular expression? Javascript regular expressions are weird in that they match carriage return/line feeds via the \s operator, but not the . operator. So if your HTML has raw line feeds in it, you need to use this expression. Also, building the regexp once and then using it over and over is much more efficient than re-invoking the RegExp constructor every interation.

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

Sidebar

Related Questions

This question has two parts: #1 I have a functions.php that is filled with
Preamble So, this question has already been answered, but as it was my first
this is my first question.. so, here we go. i have a site, 100%
this is my first question here :) I know that I should not check
I have an issue that has me stumped. We have a model assembly and
This is my first question her so please be gentle: I have followig animation
This is my first question, so forgive me if it has been asked before.
This is my first question that I haven't been able to find an answer
It has been a long question, so here is the summary first, I have
I have been searching around and it looks like this question has been asked

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.