Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.Text.RegularExpressions;
- namespace Uhrenfinder
- {
- class Program
- {
- static void Main(string[] args)
- {
- string path = @"C:\Users\Dennis\Desktop\Liste.txt";
- if (File.Exists(path))
- {
- StreamReader stream = new StreamReader(path);
- StreamWriter writer = File.CreateText(@"C:\Users\Dennis\Desktop\Uhrenliste.txt");
- Regex reg = new Regex(@"(Uhr|uhr|Ur|ur|Ugur|ugur)");
- string current = "";
- while (stream.Peek() >= 0)
- {
- current = stream.ReadLine();
- if (reg.IsMatch(current))
- {
- Console.WriteLine(current);
- writer.WriteLine(current);
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement