Why do I get validation error when I type some character even though my regular expression accepts it?
All versions of Oracle Field Service (OFS)
While trying to fill string properties within forms, your business may need to restrict the acceptable characters that the technicians can use in those fields. This restriction is handled using regular expressions, however there are some times where even having some characters filtered by the regular expression does not seem enough.
It has been observed that, due to the fact that Oracle Field Service (OFS) Application can be accessed through a multitude of devices and platforms, the way the technicians are filling data is different and dependant on the device's keyboard and keyboard settings.
For specific platforms, filling in specific characters are even triggering device functionality to change the input to some, different, special character, that may not be captured by the configured regular expression. One such example is the iOS functionality called "Smart Punctuation", however there are more cases where the character filled by specific keyboard settings isn't the one considered standard by the regular expressions.
These are the cases where we noticed devices sending a special character instead of regular characters:
- "three dots" - It was found that, due to the above mentioned iOS functionality "Smart Punctuation", if technician is typing 3 dots at some point in the string, these will be automatically replaced by special character called Horizontal Ellipsis (…). Regular expression can be amended by adding \u2026 to current formula, to cover this character.
- "two hyphens" - Similarly to above, iOS will replace two hyphens (--) when typed together by special character called Em Dash (—). Regular expression can be amended by adding \u2014 to current formula, to cover this character.
- "space" - It was also found that, under some specific keyboard settings, technicians may send a specific No-Break Space (NBSP) ( ) instead of a regular Space ( ). While regular spaces can be accepted in a regular expressions by adding \s, this specific no-break space can be accepted (or excluded) by adding \u0040 to the current formula.
Please note that there may be other cases as well which you may face and we may review and add to the above list if or when necessary.