regular expressions replace

  • Thread starter Thread starter JohnZing
  • Start date Start date
J

JohnZing

Hi
i'm trying to find a way using regular expressions to replace all the
[photoXXX] matches by an image

Exemple
[Photo123] by <img src="123.jpg">
[Photo25] by <img src="25.jpg">
and so on...

any one can help? ... thank you
 
Hi John,

try this:

Regex.Replace(Str, "\[Photo(?<first>\d+)\]", " <img src="${first}.jpg">" ,
RegexOptions.IgnoreCase)


Alex
DotNet42.com - The Answer to Your .NET Question
 
Hi John,

try this:

Regex.Replace(Str, "\[Photo(?<first>\d+)\]", " <img src="${first}.jpg">" ,
RegexOptions.IgnoreCase)


Alex
DotNet42.com - The Answer to Your .NET Question
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top