Mastering Typescript: Using Switch Statements With Regex For Efficient Code