シャドーイング練習: [Practice Problems] Regular Expressions (Regex) - Visually Explained - 動画で英語スピーキングを学ぶ

レッスンを作成中...
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!

なぜこのビデオでスピーキングの練習をするべきか?

このビデオを使ってスピーキングの練習をすることは非常に有益です。なぜなら、正規表現(Regex)のような技術的な内容を、日常的な会話に自然に組み込むことができるからです。ビデオでは、連続的なフレーズと明確な発音で説明が行われており、英語の発音を良くするための具体的なモデルを提供しています。さらに、典型的な英語表現を理解することで、IELTS スピーキング対策にも役立ちます。特に、楽しく実践的な内容なので、継続的に練習しやすいです。

文法と表現の文脈

このビデオで使用される主要な構文をいくつか分析してみましょう:

  • リテラル文字:ビデオの中で「ハイフン」や「数字」などの具体的な構成要素をリテラルとして扱うことが強調されており、これにより正規表現の簡潔さが伝わります。
  • キャラクタークラス:「0から9」というキャラクタークラスを用いて、具体的な範囲を示す方法が示されています。これにより、数値に対する理解が深まります。
  • 量指定子:量指定子を用いて、「3文字」や「4文字」を明示的に指定することで、特定のパターンを識別する方法が示されています。

これらの構造を理解することで、shadowspeakの技術を駆使して、英語の表現力を豊かにできます。

一般的な発音の落とし穴

ビデオ内で注意すべき発音に関するトラップも見逃せません。特に「正規表現」や「数量詞」といった技術用語は、特に慣れていない人にとって発音が難しいかもしれません。これらの言葉を練習する際には、特にアクセントに気を付けることで、よりスムーズに話せるようになります。また、英語の発音に自信を持つことが、shadowspeaksの実践においても重要です。苦手な単語やフレーズを繰り返し練習することで、ネイティブスピーカーに近づくことができます。

このビデオを通じて、英語のスピーキング能力を向上させ、楽しみながら学ぶことができます。正規表現の理解を深めつつ、実際の会話にどう応用するかを考えることで、効果的に英語を習得していきましょう。

シャドーイングとは?英語上達に効果的な理由

シャドーイング(Shadowing)は、もともとプロの通訳者養成プログラムで開発された言語学習法で、多言語習得者として知られるDr. Alexander Arguelles によって広く普及されました。方法はシンプルですが非常に効果的:ネイティブスピーカーの英語を聞きながら、1〜2秒の遅延で声に出してすぐに繰り返す——まるで「影(shadow)」のように話者を追いかけます。文法ドリルや受動的なリスニングと異なり、シャドーイングは脳と口の筋肉が同時にリアルタイムで英語を処理・再現することを強制します。研究により、発音精度、抑揚、リズム、連音、リスニング力、そして会話の流暢さが大幅に向上することが確認されています。IELTSスピーキング対策や自然な英語コミュニケーションを目指す方に特におすすめです。