update regex and main function