Advertisement
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;
- //07. Replace a tag
- namespace ReplaceATag
- {
- class ReplaceATag
- {
- static void Main(string[] args)
- {
- string input = Console.ReadLine();
- while (input != "end")
- {
- string pattern = @"<a.*?href.*?=(.*)>(.*?)<\/a>";
- string replace = @"[URL href=$1]$2[/URL]";
- string replaced = Regex.Replace(input, pattern, replace);
- Console.WriteLine(replaced);
- input = Console.ReadLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement