Added sorting and more regex rules