I need to specify a regular expression to validate user input, which allows the user to enter a hyphen or apostrophe on Windows Desktop or Mac OS / X operating systems.
The user can configure for the following languages:
- English
- French
- Spanish
- Portuguese
- Hawaiian
I don’t understand if I use the standard ASCII regular expression for hyphens and apostrophes (for example ['-]), whether in most cases it will capture hyphen or apostrophe keys entered by the user. I believe that my definition is pretty loose, since there are many different keyboard layouts, OS versions, and language definitions (e.g. fr_FR, ca_FR).
I checked the following resources and, as a rule, searched in google, but could not find anything special in that the ASCII code generated by a key with the extension or will always be ASCII code 45 and ASCII code 39.
NOTE. If you think this question is poorly worded, add a comment to help me improve it.
source
share