Change \A and \z to ^ and $ in regex