This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 01234567890123456789012345678901234567890123 | |
message="GoodBye Java, !! GoodBye Oracle!! Good job!!" | |
origin = "Good" | |
dest = "Hi" | |
n=3 | |
import re | |
matches = list(re.finditer(origin, message)) | |
# ↪ iter(이터레이터) 를 이용해서 origin 단어를 모두 찾아 list로 저장 | |
# matches 는 찾는 단어의 위치 정보를 포함하는 객체의 list 입니다. | |
print(matches) |