1
00:00:01,190 --> 00:00:06,410
Regular expressions are used for pattern matching from the beginning.

2
00:00:06,530 --> 00:00:12,310
It can look similar to a wild card but there are quite a big differences.

3
00:00:12,320 --> 00:00:20,000
Regular expressions can be used to much for example email address or IP address and are usually used

4
00:00:20,390 --> 00:00:21,590
among scripts.

5
00:00:21,650 --> 00:00:26,340
So let's check how it looks like here.

6
00:00:26,400 --> 00:00:30,220
They have symbols which are used for regular expression.

7
00:00:30,640 --> 00:00:36,490
Start the differences define dot represents any single character.

8
00:00:36,590 --> 00:00:50,670
So for example more dot K Menchie's bog or for example bar one key next symbol is asterisk and it is

9
00:00:50,670 --> 00:00:54,870
really confusing when you know wildcards meaning of asterisk.

10
00:00:55,260 --> 00:01:00,170
It means that preceding item must match 0 or more times.

11
00:01:00,480 --> 00:01:04,700
So call asterisk now matches.

12
00:01:04,730 --> 00:01:11,010
See how he has because that all it can be match zero times.

13
00:01:11,010 --> 00:01:12,390
This is correct.

14
00:01:12,900 --> 00:01:17,240
Then it also matches goal goal and so on

15
00:01:20,080 --> 00:01:24,190
stat of the line is represented by card.

16
00:01:24,370 --> 00:01:26,290
So card Hello Michie's.

17
00:01:26,360 --> 00:01:35,000
Well I'm starting with Hello similarily end of the line is represented by dollar sign.

18
00:01:35,000 --> 00:01:40,180
So hello dollar sign Michie's line ending with Hello.

19
00:01:40,990 --> 00:01:45,240
Square brackets are the same as for wild cards.

20
00:01:45,550 --> 00:01:55,150
Any one of character Ingo's in square brackets when we use arr. inside square brackets for example file

21
00:01:55,180 --> 00:02:03,380
one Desch the images file one file to Vios three do remember on wild wildcard.

22
00:02:03,380 --> 00:02:06,750
Exclamation mark inside brackets.

23
00:02:06,770 --> 00:02:10,400
Here it is the same situation except the one offering.

24
00:02:10,580 --> 00:02:13,530
Instead of exclamation mark we are using.

25
00:02:13,590 --> 00:02:19,460
Correct and it means any character except those enclosed in brackets.

26
00:02:19,790 --> 00:02:34,160
So file an inside square brackets get 0 1 2 3 4 5 6 7 Menchie's file 8 and file 9 next symbol is a question

27
00:02:34,160 --> 00:02:35,320
mark.

28
00:02:35,360 --> 00:02:48,260
It means that the preceding item must match 1 or 0 times so call question mark hour would match.

29
00:02:48,450 --> 00:02:52,770
Core core but not core.

30
00:02:52,870 --> 00:02:54,000
With W.

31
00:02:55,810 --> 00:03:05,110
Days go to mention that regular expression are not so easy in general and many people are learning them

32
00:03:05,170 --> 00:03:06,260
more than month.

33
00:03:06,340 --> 00:03:08,290
So don't be afraid of them.

34
00:03:08,430 --> 00:03:12,270
Once we will practice it it will be much easier.

35
00:03:14,570 --> 00:03:23,690
If preceding item must match one or more times we should use symbol plus five.

36
00:03:23,710 --> 00:03:38,550
One plus then match file 1 file 11 file 108 11 but not file number inside curly brackets it means that

37
00:03:38,580 --> 00:03:42,780
preceding item must match end times.

38
00:03:42,780 --> 00:03:51,900
That means if we have a range 0 2 9 and in curly brackets number three it would match any three digit

39
00:03:51,960 --> 00:03:59,450
number as one hundred eleven 256 and so on.

40
00:04:00,170 --> 00:04:05,460
And very similar to use in the curly bracket number with comma.

41
00:04:05,820 --> 00:04:11,680
Which means that preceding item should match the minimum number of times.

42
00:04:12,030 --> 00:04:22,490
So in our example it would match any serie or more digit number when we specify to number in the curly

43
00:04:22,490 --> 00:04:23,200
brackets.

44
00:04:23,270 --> 00:04:30,260
We are specifying minimum and maximum number of times the preceding item should match.

45
00:04:30,560 --> 00:04:41,480
So if we specify a range 0 2 9 and inside curly brackets we have numbers 1 and 3 Demetri's or one two

46
00:04:41,570 --> 00:04:43,560
or three digit number.

47
00:04:45,150 --> 00:04:47,840
Last symbol here is backslash.

48
00:04:47,950 --> 00:04:51,390
We are using it as an escape character.

49
00:04:51,610 --> 00:04:55,630
It will escape any of the special character to.

50
00:04:55,780 --> 00:04:58,420
Ignore the meaning of them.

51
00:04:58,800 --> 00:05:03,360
Of course we can use character classes and then use it.

52
00:05:03,360 --> 00:05:06,750
Don't forget to wrap it inside square brackets.

53
00:05:06,750 --> 00:05:11,930
That means that you would have Debro square brackets.

54
00:05:11,930 --> 00:05:17,430
Now let's check how to override the rejects in the script.

55
00:05:18,100 --> 00:05:26,170
If you want to know if string matches some rec X we are using the following double square brackets and

56
00:05:26,230 --> 00:05:35,480
inside some string variable then equal sign for Dubai Guilder and then Reg's a variable.

57
00:05:35,530 --> 00:05:37,970
And don't forget on spaces here.

58
00:05:40,280 --> 00:05:52,010
Now we can see the x example has also some cool feature for matching red X for example beshe rematch

59
00:05:52,400 --> 00:05:55,240
0 matches part of the string.

60
00:05:55,400 --> 00:06:07,100
Which match Reg x 4 part of string which matches HOERR I guess you can also use a variable image and

61
00:06:07,280 --> 00:06:08,500
beshe rematch.

62
00:06:08,510 --> 00:06:17,840
One match is part of the string which is represented as everything inside the exits in close parentheses.

63
00:06:18,440 --> 00:06:20,810
So how do you feel now.

64
00:06:20,810 --> 00:06:27,800
I think the best would be to write some script to see it in action and ensure that there is no magic

65
00:06:27,800 --> 00:06:28,380
at all.
