diff --git a/0004-Regular-Expressions-Match/regex_match.py b/0004-Regular-Expressions-Match/regex_match.py index 09dbdcd..3b847bc 100644 --- a/0004-Regular-Expressions-Match/regex_match.py +++ b/0004-Regular-Expressions-Match/regex_match.py @@ -43,7 +43,11 @@ RESULT = re.match(r'[A-Za-z]+', 'Python Is Great123') print(RESULT.group()) # Output: 'Python', Reason : It finds and matches the substring 'Python' up to the first space ' ' because the space is not part of [A-Za-z]. +print('Case-Insensitive Matching') +RESULT = re.match(r'hello', 'Hello World', re.IGNORECASE) +print(bool(RESULT)) # Output: True - - +print('Matching with Quantifiers') +RESULT = re.match(r'\w{6}', 'abcde12345') +print(result.group()) # Output: 'abcde1'