This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I have a requirement to find out if a field(string) contains special characters only.
Please could you let me know how do I do it?
Street Name Result
ABC – 98 False
ABC xy False
ABC – xyz False
Here's a regular expression to help you:
REGEX_CountMatches([Street Name], "[a-zA-Z0-9\s]")=0
It counts the occurrences of letters and numbers and spaces and if that count is ZERO, then it is true. It gives you a TRUE on NULL addresses. If you want to avoid NULL addresses being TRUE, then:
IIF(IsNull([Street Name]),"False", REGEX_CountMatches([Street Name], "[a-zA-Z0-9\s]")=0)
Something like this in a Formula tool will work:
!REGEX_Match([Street Name], ".*[\w].*")
Hope it helps!