Extracting a string starting with x and ending with y

Posted by DMan on Stack Overflow See other posts from Stack Overflow or by DMan
Published on 2010-03-29T01:08:57Z Indexed on 2010/03/29 1:13 UTC
Read the original article Hit count: 405

Filed under:
|

First of all, I did a search on this and was able to find how to use something like String.Split() to extract the string based on a condition. I wasn't able to find however, how to extract it based on an ending condition as well. For example, I have a file with links to images: http://i594.photobucket.com/albums/tt27/34/444.jpghttp://i594.photobucket.com/albums/as/asfd/ghjk6.jpg You will notice that all the images start with http:// and end with .jpg. However, .jpg is succeeded by http:// without a space, making this a little more difficult.

So basically I'm trying to find a way (Regex?) to extract a string from a string that starts with http:// and ends with .jpg

© Stack Overflow or respective owner

Related posts about c#

Related posts about string-manipulation