string= no modifier: regex=/^a$\n/ match => $ matches only boundary, \n matches newline [ ... ] m modifier (multi line mode): regex=/^a$\n/m match => $ matches only boundary, \n matches newline