Making regex easier with code