Use \\A regex instead of \\z in the scanner.