I have got list of ASCII Codes of character which are allowed in the name.So, I am trying to build regex patter using range(-) hypen operator and string length should be 40.
Finally, I have ended up by creating following pattern.
^([\x20-\x21\x23-\x25\x28-\x2E\x30-\x3B\x3F-\x7E\xA0-\xFF]){0,40}$
with this pattern I am specifying the range of character's ASCII codes allowed in the string.
But it throws exception of Range in reverse order. I have gone through couple of question. I have found that it happens because of hypen(-) character. So, In order to remove this problem I have to use escape sequence (-) instead of(-).
After adding escape sequence although it doesn't throw exception but it doesn't give the desire result.
So, I want to know is my pattern is correct or Is it right away to specify ASCII Code character range.
\x3F-7E->\x3F-\x7E. Just a typo, right?0,. And remove(and), no need grouping 1 symbol.\x19beforehere).