0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[JavaScript]正規表現(繰り返し)

Posted at

正規表現・繰り返しについて

今回は正規表現の中の繰り返しに関する表現方法を紹介したいと思います。

以下が繰り返しに関する構文になります。

| * | 直前の部分式が0回以上の繰り返し |
|:-----------------|------------------:|:------------------:|
| + | 直前の部分式が1回以上の繰り返し
| ? | 直前の部分式が0回か1回の繰り返し
| {n} | 直前の部分式がn回の繰り返し
| {n,} | 直前の部分式がn回以上の繰り返し |
| {,m} | 直前の部分式がm回以下の繰り返し |
| {n,m} | 直前の部分式がn回以上、m回以下の繰り返し |

これらが正規表現で用いる繰り返しの表現になります。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?