C# Programming
03-23-2010, 06:13 PM
i want to find and replace img src path by regular expression. please help.
suppose i have the below html and from there i want to replace file path of all the src attribute of image tag.
Hello
\r\n
\r\n<IMG alt=\"C:\\Documents and Settings\\All Users\\Documents\\My Pictures\\Sample Pictures\\Sunset.jpg\" src=\"C:\\Documents and Settings\\All Users\\Documents\\My Pictures\\Sample Pictures\\Sunset.jpg\">
here the file path is src=\"C:\\Documents and Settings\\All Users\\Documents\\My Pictures\\Sample Pictures\\Sunset.jpg\"
and i want to replace it with path like src="www.mysite.com/images/a.gif" with regular expression.
please guide me how can i do it with regular expression.
tbhattacharjee
suppose i have the below html and from there i want to replace file path of all the src attribute of image tag.
Hello
\r\n
\r\n<IMG alt=\"C:\\Documents and Settings\\All Users\\Documents\\My Pictures\\Sample Pictures\\Sunset.jpg\" src=\"C:\\Documents and Settings\\All Users\\Documents\\My Pictures\\Sample Pictures\\Sunset.jpg\">
here the file path is src=\"C:\\Documents and Settings\\All Users\\Documents\\My Pictures\\Sample Pictures\\Sunset.jpg\"
and i want to replace it with path like src="www.mysite.com/images/a.gif" with regular expression.
please guide me how can i do it with regular expression.
tbhattacharjee