Skip to content

Commit

Permalink
adding a file to test matching times
Browse files Browse the repository at this point in the history
  • Loading branch information
mitulbipin committed May 20, 2024
1 parent 3a7a6de commit 5f1f944
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
function check_time_regexp(regexp, text){
var t0 = new Date().getTime();;
new RegExp(regexp).test(text);
var t1 = new Date().getTime();;
console.log("Regexp " + regexp + " took " + (t1 - t0) + " milliseconds.")
}

// This payloads work because the input has several "a"s
[
// "((a+)+)+$", //Eternal,
// "(a?){100}$", //Eternal
"(a|a?)+$",
"(\\w*)+$", //Generic
"(a*)+$",
"(.*a){100}$",
"([a-zA-Z]+)*$", //Generic
"(a+)*$",
].forEach(regexp => check_time_regexp(regexp, "aaaaaaaaaaaaaaaaaaaaaaaaaa!"))

0 comments on commit 5f1f944

Please sign in to comment.