equal
deleted
inserted
replaced
79 innocently looking regular expression <code>a?{28}a{28}</code> and match it, say, against the string |
79 innocently looking regular expression <code>a?{28}a{28}</code> and match it, say, against the string |
80 <code>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</code> (that is 28 <code>a</code>s), you will soon notice that your CPU usage goes to 100%. In fact, |
80 <code>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</code> (that is 28 <code>a</code>s), you will soon notice that your CPU usage goes to 100%. In fact, |
81 Python and Ruby need approximately 30 seconds of hard work for matching this string. You can try it for yourself: |
81 Python and Ruby need approximately 30 seconds of hard work for matching this string. You can try it for yourself: |
82 <A HREF="http://talisker.inf.kcl.ac.uk/cgi-bin/repos.cgi/afl-material/raw-file/tip/progs/catastrophic.py">catastrophic.py</A> (Python version) and |
82 <A HREF="http://talisker.inf.kcl.ac.uk/cgi-bin/repos.cgi/afl-material/raw-file/tip/progs/catastrophic.py">catastrophic.py</A> (Python version) and |
83 <A HREF="http://talisker.inf.kcl.ac.uk/cgi-bin/repos.cgi/afl-material/raw-file/tip/progs/catastrophic.rb">catastrophic.rb</A> |
83 <A HREF="http://talisker.inf.kcl.ac.uk/cgi-bin/repos.cgi/afl-material/raw-file/tip/progs/catastrophic.rb">catastrophic.rb</A> |
84 (Ruby version). Here is a similar problem with the regular expression <code>(a*)* b</code>in Java: |
84 (Ruby version). Here is a similar problem with the regular expression <code>(a*)*b</code> in Java: |
85 <A HREF="http://talisker.inf.kcl.ac.uk/cgi-bin/repos.cgi/afl-material/raw-file/tip/progs/catastrophic.java">catastrophic.java</A> |
85 <A HREF="http://talisker.inf.kcl.ac.uk/cgi-bin/repos.cgi/afl-material/raw-file/tip/progs/catastrophic.java">catastrophic.java</A> |
86 </p> |
86 </p> |
87 |
87 |
88 <p> |
88 <p> |
89 You can imagine an attacker |
89 You can imagine an attacker |