Hey all, so I'm trying to allow some text input which goes through a regex check before it's sent off. I want the text to only include A-Z, 0-9, and the space " " character. Here is my code now:
if(!title.matches("[a-zA-Z0-9_]+") {
//fail
}
else {
//success
}
However this still gives the //fail
result when I input something like "This is a test"
Any ideas? Thanks all.