0

I would like to search for everything before the string http://thepaperwall.com/wallpapers/ but not including that string. I would also like to search for everything after .jpg but not including .jpg.

So my final string should look like this:

http://thepaperwall.com/wallpapers/cityscape/small/small_642331afcd78d0840485bb352d99b289b50e8467.jpg

How can I do this?

Milche Patern
  • 19,632
  • 6
  • 35
  • 52
user2360087
  • 17
  • 1
  • 1
  • 6
  • You want to achieve this with what programming language ? Also, what have you tried so far? Where is your code? – Milche Patern Dec 15 '13 at 06:56
  • I'm trying to do this in Yahoo Pipes, I tried ^.*?http://thepaperwall.com/wallpapers/ but that deletes http://thepaperwall.com/wallpapers/ which I don't want it to – user2360087 Dec 15 '13 at 07:06
  • Go straigth to the yahoo-pipes documentation will help. I found this tuto for you : http://brooksbayne.wordpress.com/2009/01/11/using-regular-expressions-with-yahoo-pipes/ OR http://pipes.yahoo.com/pipes/docs?doc=operators#Regex – Milche Patern Dec 15 '13 at 07:12
  • Related : http://stackoverflow.com/questions/2241789/extracting-number-preceding-a-particular-text-using-a-regex – Milche Patern Dec 15 '13 at 07:21

2 Answers2

2

You can use look-behind and look-ahead to get a string position between 2 other strings:

(?<=http://thepaperwall.com/wallpapers/).*(?=\.jpg)
Szymon
  • 42,577
  • 16
  • 96
  • 114
0

You need a non-capturing group:

(.*)(?:http:\/\/thepaperwall\.com\/wallpapers\/.*\.jpg)(.*)

Live demo

revo
  • 47,783
  • 14
  • 74
  • 117