string= no modifier: regex=/^a$/ match => $ matches boundary, maybe more? s modifier (single line mode): regex=/^a$/s match => $ matches boundary, maybe more? m modifier (multi line mode): regex=/^a$/m match => $ matches boundary, maybe more? string= no modifier: regex=/^a$\n/ match => $ matches only boundary, \n matches newline s modifier (single line mode): regex=/^a$\n/s match => $ matches only boundary, \n matches newline m modifier (multi line mode): regex=/^a$\n/m match => $ matches only boundary, \n matches newline string= no modifier: regex=/^a$\z/ no match => $ matches only boundary, \z fails because of newline? s modifier (single line mode): regex=/^a$\z/s no match => $ matches only boundary, \z fails because of newline? m modifier (multi line mode): regex=/^a$\z/m no match => $ matches only boundary, \z fails because of newline? string= no modifier: regex=/^a$/ no match => $ matches only boundary, \n matches first newline s modifier (single line mode): regex=/^a$/s no match => $ matches only boundary, \n matches first newline m modifier (multi line mode): regex=/^a$/m match => $ matches only boundary, \n matches first newline string= no modifier: regex=/^a$\n/ no match => $ matches only boundary, \n matches first newline s modifier (single line mode): regex=/^a$\n/s no match => $ matches only boundary, \n matches first newline m modifier (multi line mode): regex=/^a$\n/m match => $ matches only boundary, \n matches first newline