Skip to content

Commit be257db

Browse files
committed
..
1 parent 8f648d3 commit be257db

File tree

43 files changed

+507
-635
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+507
-635
lines changed

10.Regular Expressions-REGEX/01.ExtractEmails/01.ExtractEmails.csproj

Lines changed: 0 additions & 8 deletions
This file was deleted.

10.Regular Expressions-REGEX/01.ExtractEmails/Program.cs

Lines changed: 0 additions & 21 deletions
This file was deleted.

10.Regular Expressions-REGEX/02.ExtractSentencesByKeyword/02.ExtractSentencesByKeyword.csproj

Lines changed: 0 additions & 8 deletions
This file was deleted.

10.Regular Expressions-REGEX/02.ExtractSentencesByKeyword/Program.cs

Lines changed: 0 additions & 22 deletions
This file was deleted.

10.Regular Expressions-REGEX/03.CameraView/03.CameraView.csproj

Lines changed: 0 additions & 8 deletions
This file was deleted.

10.Regular Expressions-REGEX/03.CameraView/Program.cs

Lines changed: 0 additions & 26 deletions
This file was deleted.

10.Regular Expressions-REGEX/04.Weather/04.Weather.csproj

Lines changed: 0 additions & 8 deletions
This file was deleted.

10.Regular Expressions-REGEX/04.Weather/Program.cs

Lines changed: 0 additions & 47 deletions
This file was deleted.

10.Regular Expressions-REGEX/05.KeyReplacer/05.KeyReplacer.csproj

Lines changed: 0 additions & 8 deletions
This file was deleted.

10.Regular Expressions-REGEX/05.KeyReplacer/Program.cs

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System;
2+
using System.Text.RegularExpressions;
3+
4+
public class ExtractEmails
5+
{
6+
public static void Main()
7+
{
8+
string input = Console.ReadLine();
9+
10+
string pattern = @"\b(?<!\S)[a-z][a-z0-9\.\-_]+[a-z0-9]*@[a-z][a-z\-]+\.[a-z][a-z\.]+[a-z]?\b";
11+
var matches = Regex.Matches(input, pattern);
12+
13+
foreach (var match in matches)
14+
{
15+
Console.WriteLine(match);
16+
}
17+
}
18+
}

10.Regular Expressions-REGEX/Exercises/01.ExtractEmails/Program.cs

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System;
2+
using System.Text.RegularExpressions;
3+
4+
public class ExtractSentencesByKeyword
5+
{
6+
public static void Main()
7+
{
8+
string input = Console.ReadLine();
9+
string text = Console.ReadLine();
10+
string pattern = $@"\b[^.?!]*\b{input}\b[^.?!]*";
11+
12+
MatchCollection matches = Regex.Matches(text, pattern);
13+
14+
foreach (Match match in matches)
15+
{
16+
Console.WriteLine(match);
17+
}
18+
}
19+
}

10.Regular Expressions-REGEX/Exercises/02.ExtractSentencesByKeyword/Program.cs

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System;
2+
using System.Linq;
3+
using System.Text.RegularExpressions;
4+
5+
public class CameraView
6+
{
7+
public static void Main()
8+
{
9+
int[] input = Console.ReadLine()
10+
.Split()
11+
.Select(int.Parse)
12+
.ToArray();
13+
int skip = input[0];
14+
int take = input[1];
15+
16+
string input2 = Console.ReadLine();
17+
string pattern = @"(?<=\|<.{" + skip + "})([^|]{0," + take + "})";
18+
MatchCollection words = Regex.Matches(input2, pattern);
19+
20+
Console.WriteLine(string.Join(", ", words));
21+
}
22+
}

10.Regular Expressions-REGEX/Exercises/03.CameraView/Program.cs

Lines changed: 0 additions & 26 deletions
This file was deleted.

10.Regular Expressions-REGEX/Exercises/04.Weather/Program.cs

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)