changed ^ and $ to \A and \z