fork(1) download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. var str = "quick.brown/fox.jpg http://j...content-available-to-author-only...r.the/lazy/dog.png";
  9. var link = Regex.Replace(str, "\\b((?:(?:http|https)://)?[a-zA-Z./]+[.](?:jpg|png))\\b", "<img src =\"$1\"/>");
  10. Console.WriteLine(link);
  11. }
  12. }
Success #stdin #stdout 0.07s 34096KB
stdin
Standard input is empty
stdout
<img src ="quick.brown/fox.jpg"/> <img src ="http://j...content-available-to-author-only...r.the/lazy/dog.png"/>