Using Regex for spaces

Hello, I currently use !hasnext() to try and ensure that the input word doesn't have any characters other than letters, which works fine
however I am not sure how to make it so that regex also detects whether or not any spaces are in the input
Was this page helpful?