On Fri, 9 Jan 2009 19:07:45 +0000 (UTC), idesdema wrote:
> I have an <img string that I want to manipulate. Here
is the string.
>
> <img src="
http://site.com/1.jpg" width="177"
height="240" alt="image" />
>
> The first thing I want to do is strip out the <img
src=" and that is common on
> all the paths I want to manipulate so I thought I could
do a simple Replace().
> Then I'd end up with
http://site.com/1.jpg" width="177"
height="240"
> alt="image" />
>
> I need to strip everything else off that string after
the "
>
> I'm not sure how to do that... can anyone help me out?
So you want to extract the src value from an <img/>
tag? That was a very
long-winded way of describing what you need ;-)
Use a regex, and you can do it in one expression.
Match this: <img.*?src="([^"]*?)"[^>]*?>
Replace it with: \1
Pls take the time to read the regex docs and understand the
solution I've
given you...
--
Adam