regular expressions replace

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
 
A

Alex

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
 
A

Alex

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

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top