javascript split string based on regex