(no title)
jalada | 6 years ago
/.*=.*/ becomes /[^=]*=.*/
That is, zero or more 'not-equals-sign-characters', followed by an equals sign.Where the first regex is 57 steps for x=xxxxxxxxxxxxxxxxxxxxxxxx, the second is just 7.
Avoid using greedy .* for backtracking regex engines! Give your greedy regex engine the hints it needs to do what it does best.
wbl|6 years ago
Thorrez|6 years ago