Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text.RegularExpressions;
- namespace ExtractURLs
- {
- class Program
- {
- static void Main(string[] args)
- {
- List<string> list = new List<string>();
- string input = Console.ReadLine();
- string[] inputArray = input.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
- for (int i = 0; i < inputArray.Length; i++)
- {
- Match match = Regex.Match(inputArray[i], @"(https?|http|file)\://|www.)", RegexOptions.IgnoreCase);
- if (match.Success)
- {
- string key = match.Groups[1].Value;
- Console.WriteLine(key);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement