Data Reviewer does not seem to be recognizing my regular expression?

254
3
12-06-2017 12:41 PM
Highlighted
Occasional Contributor

I am trying to use Data Reviewer extension to validate parcel ID's in our parcel data. I created a Regular Expression Check on the parcels table but when I run it, it seems to return all parcel records. My understanding is that the regular expression check should only return records that do not match the regex. However, when I check the regular expression via https://regex101.com it works as expected. This makes me think that Data Reviewer is not recognizing my regular expression. The regular expression that I am trying to use is:

^(\d{3})([-])(\d{1,2})([.])(\d{2})([-])(\d{1,4})([.])(\d{2})$

This should match our parcel ID format (which can be something like 131-10.00-600.00) and should return invalid parcel ID's but as I said before, it seems to return all records in the table. 

I am using Arcmap version 10.5.1

Any ideas on why this would not be working? 

Edit: So after reading this page it looks like the data reviewer implementation of regular expressions does not support the use of the {} tokens. So now my question is: Does anyone know how to write a similar regex that would be recognized by data reviewer? I can get close but it ends up being far too inclusive. Also, are there any plans to improve the data reviewer regex implementation?

Edit 2: Well after playing around with the accepted tokens some more I was able to come up with an acceptable replacement by using the | token:
^(\d\d\d)([-])((\d)|(\d\d))([.])(\d\d)([-])((\d)|(\d\d)|(\d\d\d)|(\d\d\d\d))([.])(\d\d)$

3 Replies
Highlighted
MVP Esteemed Contributor

I wonder if you could shine some light on a similar problem I'm having with the Data Reviewer.  I want to check for the presence of any special characters in a given string field and tag as an error if found:

'!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~

If I enclose that group with brackets I'm not getting the results I figured on.  Any hints?

Thanks!

james.gough_SussexCounty

Reply
0 Kudos
Highlighted
Occasional Contributor

You will have to escape some of those characters with backslash as they are metacharacters. Also adding a plus sign at the end means match one or more times. Try this:

[\'\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~]+

Reply
0 Kudos
Highlighted
MVP Esteemed Contributor

I'll give it a try.  Thanks for your help!

Reply
0 Kudos