Regular Expressions fail in Ataccama

(sivaraman gangadharan) #1

Hello ,
I am trying to use regular expression which is tested and works fine in java but throws an error in using expression with matches function in expression editor. please let me know if there is an issue with syntax applied .

Ataccama :
matches("/^[a-zA-Z ]+$/",city_name) … value pased : siva city ( returns false)

Java example :
If you’re trying to see if a string consists entirely of a-z, A-Z and spaces, then you can use this:

/^[a-zA-Z ]+$/
Demo and tester here:
siva city - result is passed in this one

please let me know if you need more details .


(Katrin Popova) #2

Hello Siva,

I have reproduced the behavior you are describing. There is no need of slashes in the regex. They should be removed: matches("^[a-zA-Z ]+$",city_name).

Let me know if the provided solution is sufficient.

Best regards,
Katrin Popova

(sivaraman gangadharan) #3

Thanks Katrin , it works fine .