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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:11:33+00:00 2026-06-06T15:11:33+00:00

Note: all the quotation marks in this question are actually part of the code.

  • 0

Note: all the quotation marks in this question are actually part of the code.

I’m learning regex, and i’m trying to scrape a site with music on it. I put the source of the site into a text file called ‘ytcmusic.txt’. Here’s a sample of the html:

<li><a href="angelpool%20-%20know.mp3"> angelpool - know.mp3</a></li>
<li><a href="angelpool%20-%20sellout.mp3"> angelpool - sellout.mp3</a></li>
<li><a href="angelpool%20-%20time.mp3"> angelpool - time.mp3</a></li>
<li><a href="bella%20-%20gibsons.mp3"> bella - gibsons.mp3</a></li>

i’ll use the first line as an example, i’m trying to scrape only the “angelpool%20-%20know.mp3” and to do that here’s the regex i used: “.*.mp3” —— when I put it into C#, I have to surround it in quotation marks, which ruins the quotation marks in the regex. heres the code (it doesn’t compile, if you remove one set of quotation marks around the regex, it does but obviously doesnt return the correct part of the source):

var sr = new StreamReader("ytcmusic.txt");
        string str = sr.ReadToEnd();
        var match = Regex.Match(str, @".*.mp3");

thanks in advance!

  • 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-06T15:11:34+00:00Added an answer on June 6, 2026 at 3:11 pm

    This will do

    "[^"]*"
    

    Note that I’m keeping you to your sample input and assuming the titles are the only thing quoted. If that’s not the case you have to put more context into the regex.

    If you want to capture without the quotes you can introduce parenthesis like so

    "([^"]*)"
    

    In C# this becomes

    StringCollection resultList = new StringCollection();
    Regex regexObj = new Regex("\"([^\"]*)\"");
    Match matchResult = regexObj.Match(subjectString);
    while (matchResult.Success) {
        resultList.Add(matchResult.Groups[1].Value);
        matchResult = matchResult.NextMatch();
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

note: all this is on chrome I am trying to test something that responds
Note that all the code is a simplified example in order to only communicate
My table is like this on Postgres, note that all days start by 01,
Note: Although my particular context is Objective-C, my question actually transcends programming language choice.
Note this question was originally posted in 2009, before C++11 was ratified and before
Note: This question has broadened in scope from previous revisions. I have tried to
NOTE: all the code is written Top of my head. It can contains some
This code all works, but I'm basically blundering around my lack of knowledge in
Note: All sample code is greatly simplified. I have a DLL defined as: using
I am trying to find circumcenter of Given Three point of Triangle…….. NOTE: all

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.