Port regexp stuff to shin.