A lot if things dont make sense until you involve scale. Regex could be good enough do give a general gist.