I have been recently requested, to adapt an app's input, to support Unicode letters, on some of the inputs within the web app.
That app, already does some validation with regex, with the pattern
html attribute. Like so:
<input required="true" pattern="[a-zA-Z0-9_\-]+" type="text" name="name">
Now, since I have to adapt some inputs to the new requirements, I was wondering what would be better to do?
- Do Encoding / decoding UTF8 in javascript?
or
- Addapt the regex pattern just like suggested here: PHP Regex for Multiple Unicode Characters ?