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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:39:55+00:00 2026-05-12T18:39:55+00:00

I have an unfinished binary file that has some info that I can recover

  • 0

I have an unfinished binary file that has some info that I can recover using regex. The contents are:

G $12.Angry.Men.1957.720p.HDTV.x264-HDLH Lhttp://site.com/forum/f89/12-angry-men-1957-720p-hdtv-x264-hdl-538403/ L I Š M ,ABBA.The.Movie.1977.720p.BluRay.DTS.x264-iONN Phttp://site.com/forum/f89/abba-movie-1977-720p-bluray-dts-x264-ion-428687/&

How can I parse it so I can at least get links that are:

http://site.com/forum/f89/abba-movie-1977-720p-bluray-dts-x264-ion-428687/

where 428687 is the id number.

So I would have a full link and an id.

The other names that comes before are the name of the links:

ABBA.The.Movie.1977.720p.BluRay.DTS.x264-iON

Though I am not sure if these can be parsed. I noticed they all have a character before and after the LINKS and the NAMES. So maybe this can narrow down the problem?

Btw I am willing to give 500 bounty for the correct answer.

  • 1 1 Answer
  • 1 View
  • 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-12T18:39:56+00:00Added an answer on May 12, 2026 at 6:39 pm

    Something like the following regular expression?

    MatchCollection matches = Regex.Matches(yourString, @"http://\S+?-(\d+)/") 
    foreach(Match m in matches)
    {
        string id = m.Captures[0].Value;
        string url = m.Value;
    }
    

    which will grab links (starting http://) then everything not a space (spaces are guaranteed not around in HTTP (URI) links) and assumes it ends with digits and a trailing slash (this will correctly remove the & in your example or other trailing text).

    EDIT: the whole match is the link, the ID is in the first capturing parentheses, updated code to show how to get the info.

    Update: if dash+digits+slash can occur more then once in the URL, then greediness must be used, but then consecutive links (with no additional text having spaces) will be matched together. If dash+digits+slash occurs only once per URL, then laziness is preferred. This is the solution currently in the code above.

    Alternative approach

    From the updates and the extra information, I understand that there’s a lot unclear about the text. Another approach might be easier: split everything on http:// and go through the results. This prevents having to make a complex look-forward/backward regex and makes sure that consecutive links (i.e., without text in-between) are correctly treated:

    // zero-width split:
    string[] linksWithText = Regex.Split(yourString, @"(?<=http:\S+-\d+/)");
    foreach (string link in linksWithText)
    {
        Match m = Regex.Match(link, @"(.*)(http:\S+-(\d+)/)$");
        if (m.Success)
        {
            string text = m.Groups[1].Value;
            string url = m.Groups[2].Value;
            string id = m.Groups[3].Value;
        }
    }
    

    Update: alternative approach updated. The text (name) is first, then url. Note the negative look behind expression to split on a zero-width spot, taking anything before the url up to the end of the url.

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

Sidebar

Related Questions

I have a task_id table which has two columns: `tid`:task id, `state`:0:unfinished,1:processing,2:finished It's easy
I have a repository and am using mq patch queue for unfinished changes. The
Let's say I have an app that handles a TODO list. The list has
I have a parrallelized C++ program that does brute force optimization. For some reason
I have some code that sends multiple ASIHTTPRequests to upload and download data in
If we have a long running task, we can ensure that the application doesn't
With event delegation in jQuery 1.6, you can respond to events that have bubbled
Hi I have got a problem that I can't solve when compiling the android
I have a website in Magento, it's still very simple and unfinished. Since I'm
I have a website at http://www.presentbladet.se (unfinished). When I hover the Test product a

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.