use regex instead of dumb string splitting