1 00:00:00,720 --> 00:00:01,553 - [Instructor] So far, 2 00:00:01,553 --> 00:00:04,810 each of the pattern matching demonstrations we've done 3 00:00:04,810 --> 00:00:08,260 has been a case sensitive pattern match. 4 00:00:08,260 --> 00:00:10,980 However, sometimes you want to ignore case 5 00:00:10,980 --> 00:00:13,560 and it turns out it's really easy to do that. 6 00:00:13,560 --> 00:00:15,960 So here we have a call to the search function, 7 00:00:15,960 --> 00:00:18,530 which we just looked at in the previous video 8 00:00:18,530 --> 00:00:20,300 in which we're looking for the pattern 9 00:00:20,300 --> 00:00:23,730 Sam inside of the string SAM WHITE 10 00:00:23,730 --> 00:00:26,170 and clearly the cases are different here, 11 00:00:26,170 --> 00:00:30,050 and in our prior demos, that would result in no match. 12 00:00:30,050 --> 00:00:33,700 However, the fact that we're providing the flags argument 13 00:00:33,700 --> 00:00:37,860 with the re modules ignore case constant 14 00:00:37,860 --> 00:00:41,210 tells the search function to do the pattern match 15 00:00:41,210 --> 00:00:44,510 regardless of the case sensitivity of the letters 16 00:00:44,510 --> 00:00:47,520 in either the pattern or the search string. 17 00:00:47,520 --> 00:00:52,290 So in this case, if we then go ahead and test our result. 18 00:00:52,290 --> 00:00:54,120 So, if indeed, there is a result, 19 00:00:54,120 --> 00:00:56,930 we will display the match and as you can see, 20 00:00:56,930 --> 00:01:01,690 it matched the capital SAM even though the original pattern 21 00:01:01,690 --> 00:01:04,973 had a mix of upper case and lower case letters.