Results 1 to 5 of 5

Thread: regex for scraping

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2011
    Posts
    184

    regex for scraping

    I'm trying to scrape the number after the "/" and before the "?". In this example, I'm trying to scrape 170925953396. Anyone know what the regex is?

    http://www.ebay.com/itm/NIKE-MEN-TRA...item27cbfb1174

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Aug 2011
    Posts
    184

    Re: regex for scraping

    The url was truncated.

    ebay.com/itm/NIKE-MEN-TRAINING-RUNNING-SHOES-LUNAR-EDGE-WHITE-SIZE-10-5-NEW-886059090595-/170925953396?pt=US_Men_s_Shoes&hash=item27cbfb1174

  3. #3
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: regex for scraping

    Label1.Text = Regex.Match(s, "(?<=/)(?<Name>\d*)(?=\?)").ToString
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  4. #4
    Frenzied Member Lightning's Avatar
    Join Date
    Oct 2002
    Location
    Eygelshoven
    Posts
    1,611

    Re: regex for scraping

    That would be:
    /\d+\?
    VB6 & C# (WCF LINQ) mostly


    If you need help with a WPF/WCF question post in the NEW WPF & WCF forum and we will try help the best we can

    My site

    My blog, couding troubles and solutions

    Free online tools

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Aug 2011
    Posts
    184

    Re: regex for scraping

    (?<=\/)(?<Name>\d*)(?=\?) works. (/ needed to be escaped).
    /\d+\? scrapes the number with a ? at the end.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width