Shadowing Practice: [Practice Problems] Regular Expressions (Regex) - Visually Explained - Learn English Speaking with Video

Bir pratik modu seçin

Her mod tam ekran bir pratik odası açar.

61 cümleler
Cümleler çok kısa veya çok uzun ise, ayarlamak için Düzenle'ye tıklayın.
1
Have you tried our regular expressions practice exercises?
2
If you have, great!
3
We're going to work through the solutions now.
4
If not, the problems are linked in the description.
5
Alright, let's start with problem one.
6
In this problem, we want to match all the phone numbers from the bulletin board text.
7
Each phone number follows the format.
8
A fixed area code, and a hyphen, followed by three digits, another hyphen, and a final four digits.
9
Since every phone number starts with the same area code and hyphen, we write the literal characters 1, 2, 3, hyphen directly into the pattern box.
10
Next, the middle group of numbers can have any combination of three digits.
11
To match this, we use the character class 0 through 9 to match a single digit
12
and follow it with the quantifier 3 to match exactly 3.
13
Following the character class, we write another literal hyphen.
14
To match the last four digits, like the middle three, we use a character class with 0 through 9.
15
But to match four digits instead of 3, we use a quantifier of 4.
16
Great!
17
As we can see, this pattern matches both phone numbers and our bulletin board text.
18
Fixed quantifiers like 3 and 4 are ideal when you know the exact length you're looking for.
19
Phone numbers, zip codes, product codes, anything with a predictable structure.
20
Quantifiers will also be quite useful in problem 2.
21
In this problem, we want to write a regular expression to match all the prices in our text string.
22
each price starts with a dollar sign followed by one
23
or more digits a dot
24
and exactly two digits for cents you might be tempted to start by writing the literal dollar sign character
25
but in regex dollar sign is a special syntax
26
that means end of line
27
so it won't match the dollar sign character to match a
28
literal dollar sign we put a backslash in front of it after the dollar sign comes the digits before the decimal,
29
which we can match using a character class with 0 through 9.
30
Since there could be any number of digits before the decimal, we use the plus quantifier to match one or more digits.
31
Following this character class, we specify a dot.
32
Remember, like the dollar sign, the dot is special syntax, called a wildcard, that matches any single character.
33
To use a literal dot character, we need to write a backslash before it.
34
Finally, cents always have exactly two digits.
35
To match this, we write a character class allowing the digits 0 through 9 and a quantifier of 2.
36
Awesome!
37
With this pattern, all five prices are matched.
38
Before we move on, we've now written the character class containing 0 through 9 several times.
39
Since this is such a common pattern, regex syntax actually provides a shorthand for it.
40
Instead of explicitly writing the character class, we write backslash d, which also means any digit.
41
Awesome, our pattern is now more concise and we still get the same matches.
42
We'll use the digit shorthand backslash d again in problem 3.
43
In this problem, we want to match all the dates in the text.
44
Each date has a month name, a day number, and a four-digit year.
45
We'll start by matching the month names.
46
Month names are made up of letters, both upper and lowercase, so we'll use a character class of all the uppercase and lowercase letters.
47
To match one or more letters, we follow the class with the plus quantifier.
48
After the month name comes a literal space.
49
After the space, the day can be one digit or two.
50
To match exactly one or two digits,
51
we use the backslash d shorthand followed by a range quantifier with a lower bound of one and upper bound of two.
52
Following the day, we write a literal comma and space.
53
Lastly, the year is always four digits, so we write the digit shorthand and a quantifier of four.
54
Awesome!
55
With that pattern, we've matched all the dates.
56
With these practice problems, you've seen how to write patterns for three different data types.
57
If you want to go deeper on any of the concepts we used in this video, check out our regular expressions intro video linked in the description.
58
We're working on lots more Python explainer videos like this one, so be sure to subscribe so that you don't miss out.
59
If you have any questions or topics that you'd like to learn about, let us know in the comments below.
60
We'd love to hear from you.
61
Thanks for watching!

Uygulamayı İndir

Akıcı konuşmak için ihtiyacınız olan her şey

AI TelaffuzHer cümleyi puanla
IPA AlıştırmasıHer sesi ustalaştır
Kelime BilgisiKelime bankanızı oluşturun
Kelime OyunuOynarken öğrenin

Aynı Kanal

FOR YOU

Video Öner

Bu dersin kelimeleri ve konuşma notları

Bu videoda gölgeleme çalışması için 61 cümle ve 744 kelime var. Konuşma bölümü 5:08 sürüyor. Konuşmacı dakikada yaklaşık 145 kelimelik dengeli bir hızla konuşuyor; gölgeleme için rahat bir tempo. Kelimelerin %82’i İngilizcede en sık kullanılan 3.000 kelime arasında; geri kalanına başlamadan önce bakmakta fayda var.

Bu videodaki önemli kelimeler

Videodan daha az kullanılan 14 kelime, telaffuzu ve anlamıyla:

  • digit /ˈdɪd͡ʒɪt/ (isim) — rakam. A position in a sequence of numerals representing a place value in a positional number system.
  • syntax /ˈsɪn.tæks/ (isim) — sözdizimi, sentaks. A set of rules that govern how words are combined to form phrases and sentences.
  • topic /ˈtɑpɪk/ (isim) — mevzu, tema. A subject; a theme; a category or general area of interest.
  • string /stɹɪŋ/ (isim) — ip, tel. A long, thin and flexible structure made from threads twisted together.
  • subscribe /səbˈskɹaɪb/ (fiil) — abone olmak. To write (one’s name) at the bottom of a document; to sign (one's name).
  • predictable /pɹəˈdɪktəbləl/ (sıfat) — öngörülebilir. Able to be predicted.
  • quantifier /ˈkwɑn.tɪ.faɪ.ɚ/ (isim) — niceleme. A word, such as all or many, that expresses the quantity of a related noun.
  • backslash /ˈbækˌslæʃ/ (isim) — ters bölü. The punctuation mark \ (a left-leaning diagonal line). (Common uses include (1) use as a delimiter in filepaths and (2) use as an escape character to mark…
  • hyphen /ˈhaɪ̯.f(ə̯)n̩/ (isim) — tire, kısa çizgi. The symbol "‐", typically used to join two or more words to form a compound term, or to indicate that a word has been split at the end of a line.
  • shorthand /ˈʃɔɹthænd/ (isim) — stenografi. A rough and rapid method of writing by substituting symbols for letters, words, etc.
  • decimal /ˈdɛs.ɪ.məl/ (isim) — ondalık sistem. A number expressed in the base-ten system, (particularly) a fractional numeral written in this system.
  • comma /ˈkɒmə/ (isim) — virgül. The punctuation mark ⟨,⟩ used to indicate a set of parts of a sentence or between elements of a list.
  • concise /kənˈsaɪs/ (sıfat) — mucez, özlü. Brief, yet including all important information.
  • tempt /tɛmpt/ (fiil) — ayartmak, baştan çıkarmak. To provoke someone to do wrong, especially by promising a reward; to entice.

Duyacağınız deyimsel fiiller

  • check out (fiil) — gözden geçirmek. To record the departure or withdrawal of someone or something (such as guests, employees, books, etc.).
  • look for (fiil) — aramak. To seek.
  • miss out (fiil) — kaçırmak. To miss an experience or lose an opportunity, etc. that should not be missed.
  • move on (fiil) — başka konuya geçmek. To continue; to proceed; to go on.

Dikkat edilecek telaffuzlar

Konuşmacı we'll, we're, we've gibi kısaltılmış biçimleri 13 kez kullanıyor. Bunları duyduğunuz gibi kısa söyleyin.

  • “sh” ve “zh” sesleri: backslash /ˈbækˌslæʃ/, shorthand /ˈʃɔɹthænd/
  • Uzun kelimeler — vurguyu doğru yere koyun: predictable /pɹəˈdɪktəbləl/, quantifier /ˈkwɑn.tɪ.faɪ.ɚ/

Bu videoyla nasıl çalışılır

  1. Videonun tamamını konuşmadan bir kez dinleyin ve bilmediğiniz kelimeleri not edin.
  2. Normal hızda cümle cümle tekrar edin; ritminiz konuşmacıyla aynı olana kadar her cümleyi yineleyin.
  3. Kendinizi kaydedin ve orijinaliyle karşılaştırın; digit, syntax, topic gibi kelimelere özellikle dikkat edin.

Bu videodaki dil bilgisi

Konuşmacının en çok kullandığı yapılar, videodaki sözcüklerin aynısıyla:

YapıVideoda
Present perfect have/has + fiilin üçüncü hâli — geçmişte olan ama şimdi de önemli olan bir eylemHave you tried · we've now written · we've matched
Edilgen yapı be + fiilin üçüncü hâli — kimin yaptığı değil, ne olduğu önemliare linked · might be tempted · are matched

Gölgeleme Tekniği Nedir?

Gölgeleme, başlangıçta profesyonel tercüman eğitimi için geliştirilen ve çok dilli Dr. Alexander Arguelles tarafından popüler hale getirilen, bilim destekli bir dil öğrenme tekniğidir. Yöntem basit ama güçlüdür: ana dili İngilizce olan bir sesi dinler ve hemen yüksek sesle tekrar edersiniz — konuşmacıyı 1-2 saniye gecikmeyle takip eden bir gölge gibi. Pasif dinleme veya dilbilgisi alıştırmalarının aksine, gölgeleme beyninizi ve ağız kaslarınızı gerçek konuşma kalıplarını eşzamanlı olarak işlemeye ve yeniden üretmeye zorlar. Araştırmalar, telaffuz doğruluğu, tonlama, ritim, bağlı konuşma, dinleme anlama ve konuşma akıcılığını önemli ölçüde geliştirdiğini göstermektedir — bu da onu IELTS Konuşma hazırlığı ve gerçek dünya İngilizce iletişimi için en etkili yöntemlerden biri yapar.

Shadowing tekniği: adım adım eksiksiz rehberi okuyun →