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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:53:36+00:00 2026-05-17T02:53:36+00:00

Sorry, I know this is probably a duplicate but having searched for ‘python regular

  • 0

Sorry, I know this is probably a duplicate but having searched for ‘python regular expression match between’ I haven’t found anything that answers my question!

The document (which to make clear, is a long HTML page) I’m searching has a whole bunch of strings in it (inside a JavaScript function) that look like this:

link: '/Hidden/SidebySideGreen/dei1=1204970159862'};
link: '/Hidden/SidebySideYellow/dei1=1204970159862'};

I want to extract the links (i.e. everything between quotes within these strings) – e.g. /Hidden/SidebySideYellow/dei1=1204970159862

To get the links, I know I need to start with:

re.matchall(regexp, doc_sting)

But what should regexp be?

  • 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-05-17T02:53:37+00:00Added an answer on May 17, 2026 at 2:53 am

    The answer to your question depends on how the rest of the string may look like. If they are all like this link: '<URL>'}; then you can do it very simple using simple string manipulation:

    myString = "link: '/Hidden/SidebySideGreen/dei1=1204970159862'};"
    print( myString[7:-3] )
    

    (If you just have one string with multiple lines by that, you can just split the string into lines.)

    If it is a bit more complex though, using regular expressions are fine. One example that just looks for the url inside of the quotes would be:

    myDoc = """link: '/Hidden/SidebySideGreen/dei1=1204970159862'};
    link: '/Hidden/SidebySideYellow/dei1=1204970159862'};"""
    
    print( re.findall( "'([^']+)'", myDoc ) )
    

    Depending on how the whole string looks, you might have to include the link: as well:

    print( re.findall( "link: '([^']+)'", myDoc ) )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry I know this question has probably been asked before, but do you know
I know this has a stupid solution but, sorry, I'm little bit confused. I
Sorry, I know this question is easy, but I don't know how to get
sorry, i know this lots on this topic, but i couldnt find one where
Sorry that I can't find the answer through google - But I know this
sorry for this question, but i dont know where to search for it, or
( I know this is probably a simple question to answer, but I don't
Sorry, that title probably doesn't make much sense, but what I want to know
Sorry, I know this is programming 101, but I can't find any good documentation...
First, sorry this is so long. I probably don't need all the code, but

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.