1. A non-transitory computer readable medium storing software instructions which, when executed by a processor, cause the processor to perform a method for estimating a worst-case time complexity of a regular expression comprising one or more back-references (backref-regex), the method comprising: constructing a non-deterministic finite automaton (NFA) corresponding to the backref-regex (backref-NFA), wherein the backref-NFA comprises a plurality of NFA-states and a respectively labeled edge for each of the one or more back-references of the backref-regex; performing liveness analysis on the backref-NFA to determine for each NFA-state of the backref-NFA a set of back-references alive at the NFA-state; and determining a maximum number of alive back-references over the plurality of NFA-states, wherein the determined maximum number is indicative of the worst-case time complexity of the backref-regex.
1. A non-transitory computer readable medium storing software instructions which, when executed by a processor, cause the processor to perform a method for estimating a worst-case time complexity of a regular expression comprising one or more back-references (backref-regex), the method comprising: constructing a non-deterministic finite automaton (NFA) corresponding to the backref-regex (backref-NFA), wherein the backref-NFA comprises a plurality of NFA-states and a respectively labeled edge for each of the one or more back-references of the backref-regex; performing liveness analysis on the backref-NFA to determine for each NFA-state of the backref-NFA a set of back-references alive at the NFA-state; and determining a maximum number of alive back-references over the plurality of NFA-states, wherein the determined maximum number is indicative of the worst-case time complexity of the backref-regex. 6. The medium of claim 1 , wherein the method further comprises: comparing a value of the worst-case time complexity indicated by the determined maximum number to a pre-defined threshold; and if the indicated worst-case time complexity value is above the pre-defined threshold, flagging a potentially bad pattern.