fixed regex

Javascript halted on regex null value