Got the first regex function working. Took a while.