简体   繁体   中英

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

In PCRE, what's the difference between:

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

I remember reading there was a subtle difference, but can't recall exactly what it was.

By default, there is no difference between the two, they both signify the start or end of the string. If, however, you use the m modifier, then ^ and $ will match the start and end of lines, respectively.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM