Most library implementations of regular expressions use a backtracking algorithm that can take an exponential amount of time on some inputs.

NFA

Running time. M = length of expression, N = length of input.

Regular expression matching algorithm can create NFA in O(M) time and simulate input in O(MN) time.

NFA cannot match non-regular pattern, therefore the of perl and java etc. did not adopt this?

results matching ""

    No results matching ""