scanner.useDelimiter("\\A").hasNext() ? scanner.next() : "";
What is the significance of "\\A"
here? As far as I know this will match literally \A
Also I have seen people using "\\Z"
at the same place.
In regex
For more details, refer below the link.