PCRE: ^ | $ and \ A | \ Z?

In PCRE, what's the difference between:

  • ^ and \A , and
  • $ and \Z ?

I remember reading the subtle difference, but I couldn’t remember exactly what it was.

+4
source share
1 answer

By default, there is no difference between them, they mean the beginning or end of a line. If, however, you use the m modifier, then ^ and $ will correspond to the beginning and end of lines, respectively.

+5
source

All Articles