■ compile 함수에서 IGNORECASE(또는 I) 정규식 컴파일 옵션을 사용하는 방법을 보여준다.
▶ 예제 코드 (PY)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
import re text = "Apple is a big company and apple is very delicious." pattern = re.compile("apple", re.IGNORECASE) list1 = pattern.findall(text) print(list1) """ ['Apple', 'apple'] """ |