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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:08:45+00:00 2026-06-11T02:08:45+00:00

I am trying parse the ESPN bottom line feed using RegEx but am coming

  • 0

I am trying parse the ESPN bottom line feed using RegEx but am coming up a bit short. Instead of it getting all of the NFL games it is only getting about half.

This is the data returned by ESPN.

 &nfl_s_delay=120&nfl_s_stamp=0909064837&nfl_s_left1=^Dallas 24   NY Giants 17 (FINAL)&nfl_s_right1_count=0&nfl_s_url1=http://sports.espn.go.com/nfl/boxscore?gameId=320905019&nfl_s_left2=Indianapolis at Chicago (1:00 PM ET)&nfl_s_right2_count=0&nfl_s_url2=http://sports.espn.go.com/nfl/preview?gameId=320909003&nfl_s_left3=Philadelphia at Cleveland (1:00 PM ET)&nfl_s_right3_count=0&nfl_s_url3=http://sports.espn.go.com/nfl/preview?gameId=320909005&nfl_s_left4=St. Louis at Detroit (1:00 PM ET)&nfl_s_right4_count=0&nfl_s_url4=http://sports.espn.go.com/nfl/preview?gameId=320909008&nfl_s_left5=New England at Tennessee (1:00 PM ET)&nfl_s_right5_count=0&nfl_s_url5=http://sports.espn.go.com/nfl/preview?gameId=320909010&nfl_s_left6=Atlanta at Kansas City (1:00 PM ET)&nfl_s_right6_count=0&nfl_s_url6=http://sports.espn.go.com/nfl/preview?gameId=320909012&nfl_s_left7=Jacksonville at Minnesota (1:00 PM ET)&nfl_s_right7_count=0&nfl_s_url7=http://sports.espn.go.com/nfl/preview?gameId=320909016&nfl_s_left8=Washington at New Orleans (1:00 PM ET)&nfl_s_right8_count=0&nfl_s_url8=http://sports.espn.go.com/nfl/preview?gameId=320909018&nfl_s_left9=Buffalo at NY Jets (1:00 PM ET)&nfl_s_right9_count=0&nfl_s_url9=http://sports.espn.go.com/nfl/preview?gameId=320909020&nfl_s_left10=Miami at Houston (1:00 PM ET)&nfl_s_right10_count=0&nfl_s_url10=http://sports.espn.go.com/nfl/preview?gameId=320909034&nfl_s_left11=San Francisco at Green Bay (4:25 PM ET)&nfl_s_right11_count=0&nfl_s_url11=http://sports.espn.go.com/nfl/preview?gameId=320909009&nfl_s_left12=Seattle at Arizona (4:25 PM ET)&nfl_s_right12_count=0&nfl_s_url12=http://sports.espn.go.com/nfl/preview?gameId=320909022&nfl_s_left13=Carolina at Tampa Bay (4:25 PM ET)&nfl_s_right13_count=0&nfl_s_url13=http://sports.espn.go.com/nfl/preview?gameId=320909027&nfl_s_left14=Pittsburgh at Denver (8:20 PM ET)&nfl_s_right14_count=0&nfl_s_url14=http://sports.espn.go.com/nfl/preview?gameId=320909007&nfl_s_left15=Cincinnati at Baltimore (7:00 PM ET)&nfl_s_right15_count=0&nfl_s_url15=http://sports.espn.go.com/nfl/preview?gameId=320910033&nfl_s_left16=San Diego at Oakland (10:15 PM ET)&nfl_s_right16_count=0&nfl_s_url16=http://sports.espn.go.com/nfl/preview?gameId=320910013&nfl_s_count=16&nfl_s_loaded=true

I am using two RegEx patterns, one to catch games that are completed/in progress:

preg_match_all('/nfl_s_left\d{1,2}=\^?(?P<awayteam>[a-zA-Z]+(?:\s+[a-zA-Z]+)*)\s+(?P<awayscore>\d+)\s+\^?(?P<hometeam>[a-zA-Z]+(?:\s+[a-zA-Z]+)*)\s+(?P<homescore>\d+)\s+(?P<time>\(.*?\))/', $content, $matches_in_progress, PREG_SET_ORDER);

And another to catch games that haven’t started yet:

preg_match_all('/nhl_s_left\d=\^?(?P<awayteam>[a-zA-Z]+(?:\s+[a-zA-Z]+)*)\s+(at)+\s+\^?(?P<hometeam>[a-zA-Z]+(?:\s+[a-zA-Z]+)*)\s(?P<time>\(.*?\))/', $content, $matches_upcoming, PREG_SET_ORDER);

Only 8 of the 16 games match, and I can’t figure out why. The matches for this week are Dallas at NY Giants, Philadelphia at Cleveland, New England at Tennessee, Atlanta at Kansas City, Jacksonville at Minnesota, Washington at New Orleans, and Buffalo at NY Jets.

I’d very much appreciate any help getting my RegEx to match all 16 games for this week and weeks to come.

Edit: Modified string to match, forgot that I strip %20 before applying RegEx to it.

  • 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-11T02:08:47+00:00Added an answer on June 11, 2026 at 2:08 am

    Found the error. I did not have d{1,2} in the 2nd regex to match games 10-16. And I also didn’t have +(?:\.*) which forced St. Louis to be skipped over.

    My new, working RegEx is:

    /nfl_s_left\d{1,2}=\^?(?P<awayteam>[a-zA-Z]+(?:\.*)+(?:\s+[a-zA-Z]+)*)\s+(at)+\s+\^?(?P<hometeam>[a-zA-Z]+(?:\s+[a-zA-Z]+)*)\s(?P<time>\(.*?\))/
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to parse a YouTube feed using PHP simplexml_load_file(); I am able to access
Im trying to parse twitter trends but i keep getting a parser error at
Am trying to parse the RSS feed from www.ted.com/talks/rss, I can access all normal
Whilst trying to parse MS Excel file using POI-HSSF v3.2 I am getting IndexOutOfBoundsException.
I trying to parse some xml in Google Refine using Jython and ElementTree but
Trying to parse a CSV file, but still getting the error message Unquoted fields
Trying to parse the following json using gson in my android app but givien
Trying to parse some XML but apparently this is too much for a lazy
Trying to parse an iTunes Atom feed with a PHP script. If you visit
Im trying to parse the string located in /proc/stat in a linux filesystem using

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.