try catch instead of regex
clean up