郵便番号や電話番号を見つける正規表現
この記事のポイント
- パターンを書く
- 文章を入れる
- 件数を見る
正規表現テスター に「\d{3}-\d{4}」と入れると、郵便番号の形を探せます。
手順
- パターンを書く
- 文章を入れる
- 件数を見る
「\d」は数字1文字、「{3}」は3回の繰り返しです。
正規表現テスターを使う(無料)
あわせて使えるツール
- 2つの文章の違いを調べる:2つの文章の違いを、行ごとに色つきで示します。
- 文字数カウント(エントリーシート・レポート用):文章の文字数・行数・原稿用紙の枚数などを数えます。
- 重複した行を消す・並べ替える:重複した行を消して、並べ替えます。
同じツールの、ほかの解説
Regex for Postal and Phone Numbers
Key points
- Write a pattern
- Enter the text
- Check the count
Entering "\d{3}-\d{4}" in Regex Tester finds the shape of a postal code.
Steps
- Write a pattern
- Enter the text
- Check the count
"\d" is one digit and "{3}" means three times.
Use "Regex Tester" (free)
Tools that go well with this
- Compare Two Texts (Diff): Show the differences between two texts line by line.
- Character Counter (for Applications and Reports): Count characters, lines and manuscript sheets of your text.
- Remove Duplicate Lines and Sort a List: Remove duplicate lines and sort them.