LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-09-2013, 07:43 AM   #1
ougk
LQ Newbie
 
Registered: Oct 2011
Posts: 5

Rep: Reputation: Disabled
Regex for getting the links in a url


Hello all,

I am programming a caching service in python and I want to allow people to declare the content of interest that should be cached. I am trying to allow this using regex, so can I get some help with :

a) what's the regex that says cache everything in a domain if the request comes as
{“expr”:http://site.com/*}
(i am guessing that * is not correct)

b) the regex that says cache everything from site.com that is mp4
{“expr”:http://site.com/*.mp4}

c) the regex that says cache everything that is mp4
{“expr”:http://*/*.mp4}


I am new to regex and I guess that for an experienced programmer it won't be difficult to help me.
 
Old 09-10-2013, 05:16 PM   #2
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
http://docs.python.org/2/howto/regex.html
or
http://docs.python.org/3/howto/regex.html

I haven’t checked, they are probably much the same

but consult the one that is closest to your python version
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Not able to run 'links -g <URL> honeybadger Slackware 16 05-28-2018 05:45 AM
[SOLVED] java regex for links: trscookie Programming 9 03-24-2011 10:45 AM
Squid: url regex problem mianmajidali Linux - Server 5 01-20-2010 11:35 AM
Problem while extracting a relative URL (regex) redvivi Programming 10 08-26-2008 11:50 AM
Can't open URL links in Thunderbird unixfreak Linux - Newbie 4 10-18-2004 11:00 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration