Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Text.RegularExpressions;
- using System.Threading.Tasks;
- namespace _06.Replace_a_Tag
- {
- class Program
- {
- static void Main(string[] args)
- {
- string text = Console.ReadLine();
- while (text != "end")
- {
- string pattern = @"<a.*?href.*?=(.*)>(.*?)<\/a>";
- string replace = @"[URL href=$1]$2[/URL]";
- string replaced = Regex.Replace(text, pattern , replace);
- Console.WriteLine(replaced);
- text = Console.ReadLine();
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment