BaşlayınÜcretsiz Başlayın

More regex with re.search()

In this exercise, you'll utilize re.search() and re.match() to find specific tokens. Both search and match expect regex patterns, similar to those you defined in an earlier exercise. You'll apply these regex library methods to the same Monty Python text from the nltk corpora.

You have both scene_one and sentences available from the last exercise; now you can use them with re.search() and re.match() to extract and match more text.

Bu egzersiz

Introduction to Natural Language Processing in Python

kursunun bir parçasıdır
Kursu Görüntüle

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Search for the first occurrence of "coconuts" in scene_one: match
match = re.____("____", scene_one)

# Print the start and end indexes of match
print(____, ____)
Kodu Düzenle ve Çalıştır