Swift regex for characters and empty spaces -


i'm trying regex expression allow characters , spaces full name field i.e. mr bob smith

what i've tried:

let textregex = "[a-za-z+\\s]" let textregex = "[a-za-z ]" let textregex = "[a-za-z+ ]" let textregex = "([a-za-z ])" 

it doesn't appear working.

thanks

your regular expression isn't working because misplaced + symbol.

this 1 work:

([a-za-z ]+) 

i don't know how swift handles regex keep in mind if strictly want whitespaces only, better add " " character instead of \s can extended other spaces.


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -