Fixed find/replace infinite loop with regex