Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Help with Regex to get images
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
isaac2004  
View profile  
 More options May 12, 11:51 pm
From: isaac2004 <levin.is...@gmail.com>
Date: Tue, 12 May 2009 20:51:59 -0700 (PDT)
Local: Tues, May 12 2009 11:51 pm
Subject: Help with Regex to get images
hi,
im trying to get the playerId for a baseball player from ESPN's
website. the info is in a link like so

<a href="/mlb/players/profile?playerId=6195">Hanley Ramirez</a></td>

im trying to just get the 6195 but am having some trouble doing it.
can someone help me. thanks


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eugeny Sattler  
View profile  
 More options May 18, 6:50 am
From: Eugeny Sattler <eugeny.satt...@gmail.com>
Date: Mon, 18 May 2009 15:50:33 +0500
Local: Mon, May 18 2009 6:50 am
Subject: Re: Help with Regex to get images
(view this in non-proportional font like Courier)

why not use  just
/mlb/players/profile\?playerId=(\d+)\"\>([^<]+)\</a>
                               \__/      \___/
                                 │         │
                          $1 will catch    │
                         numeric playerID  │
                                           │
                                          $2 will catch
                                          player name

i would add optional spaces \s* , just in case:
/mlb/players/profile\?playerId=(\d+)\s*\"\s*\>\s*([^<]+)\s*\</a>


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
DuCakedHare  
View profile  
 More options Jun 4, 6:34 am
From: DuCakedHare <dch....@googlemail.com>
Date: Thu, 4 Jun 2009 03:34:37 -0700 (PDT)
Local: Thurs, Jun 4 2009 6:34 am
Subject: Re: Help with Regex to get images
In minimalist fashion, for future:

\?playerId=(\d+).*?>(.+)</a>

You only need to identify the playerId item and extract the number,
whatever the path to that ID
After that, if for some reason another tag appears after that, it will
be ignored.
Assuming it's in a A element, then the closing </a> is sufficent to
detect.

On May 13, 4:51 am, isaac2004 <levin.is...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google