Solved

Reguler Expression in.NET

Posted on 2003-11-18
4
345 Views
Last Modified: 2012-06-21
"aleabanr.gif"

<IMG src="cid:000801c3ad09$ab7f3f60$70c0c0c0@whadmin.com" align=3Dbottom>

Reguler expression for replacing cid:000801c3ad09$ab7f3f60$70c0c0c0@whadmin.com
with "aleabanr.gif"

we need to search for <img src= and retrive the "cid...." and then replace it with "aleabanr.gif"

I need the Reguler expression to do this....
0
Comment
Question by:me_new
4 Comments
 
LVL 4

Accepted Solution

by:
krznpsk earned 50 total points
ID: 9797311

Dim imgSrcPattern As String = "<img src=""([^""]*)"""
Dim imgSrcReplace As String = "<img src=""aleabanr.gif"""
' Check RegEx match...
If System.Text.RegularExpressions.Regex.Match(yourText, imgSrcPattern).Success Then
     ' Perform RegEx replace
     yourText = System.Text.RegularExpressions.Regex.Replace(yourText, imgSrcPattern, imgSrcReplace)
End If
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Purpose To explain how to place a textual stamp on a PDF document.  This is commonly referred to as an annotation, or possibly a watermark, but a watermark is generally different in that it is somewhat translucent.  Watermark’s may be text or graph…
A short article about problems I had with the new location API and permissions in Marshmallow
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now