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
Post a Comment