Fixed issue #3846: ScanFile hangs commit dialog (fixed regex backtracking)