I want to accept a string as long as it contains alphabetical letters, for example: String testStr = "hello world 1. ?"
I am currently using this: testStr.matches("^[a-zA-Z\\\\s]+")
, but it won't accept strings that have characters outside of the alphabet.
So I am wondering how to use regex in this situation.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.