regex: java.util.regex companion code (groups, lookarounds, replaceAll lambdas, ReDoS and timeouts)
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KqJyCidz3ZgRyHABv2GVJh
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
input: 40 x 'a' + '!' budget 1000 ms
|
||||
vulnerable (?:(?:a+)+)+b ABORTED after 1019 ms
|
||||
rewritten a+b 0 ms matches=false
|
||||
possessive (?:a++)++b 7 ms matches=false
|
||||
atomic (?>(?:a+)+)b 0 ms matches=false
|
||||
|
||||
find() a+b n=5000 139 ms found=false
|
||||
find() a+b n=10000 489 ms found=false
|
||||
find() a+b n=20000 1906 ms found=false
|
||||
find() (?<!a)a+b n=5000 6 ms found=false
|
||||
find() (?<!a)a+b n=10000 6 ms found=false
|
||||
find() (?<!a)a+b n=20000 15 ms found=false
|
||||
Reference in New Issue
Block a user