Groups | Blog | Home
all groups > asp.net building controls > march 2006 >

asp.net building controls : regex replace


AVL
3/26/2006 8:55:01 PM
Hi.
I've a requirement in regular exp..
I need to replace a pattern...can anyone help me out,...

My input string is as below
<img src="c:\windows\images\bluehills.jpg"><a heref="sfjs">
<img src="c:\vij\granny.bmp">.........

My output string should be like
<img src="D:\images\bluehills.jpg"><a heref="sfjs">
<img src="D:\Images\granny.bmp">.........

Alexey Smirnov
3/30/2006 1:03:19 PM
Regex.Replace(My_input_string, "c:\\.*?\\(?=\w*?\.)", "D:\images\")



[quoted text, click to view]

AddThis Social Bookmark Button