LoginSignup
6
7

More than 5 years have passed since last update.

恐ろしく時間がかかる正規表現の例

Posted at
/(A*)*B/.test("AAAAAAAAAAAAAAAAAAAAAAAAAAA")

最初の(A*)*が組み合わせ爆発を起こしていて、
なおかつ最後のBにはいつまでたってもマッチしないので、
全ての組み合わせをテストし続けるんだそうです。

6
7
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
6
7