Regular expression to prevent non ascii only working for null
I’m trying to prevent non ascii characters from being committed in a comments box. Working on an app and found a user tried to copy and paste code that caused errors. I created a regular expression using [\x00-\x7F]. This works on regex101.com. It allows null to write (not putting anything in the box). But inputting anything else from the keyboard causes my error message to show under the comments box. I want to avoid making a microflow to handle it. Want to alert the user bad data is input and have them reinput something else.
It’s not what you asked for, but this may help.
Take a look at the StringSimplify action in the Community Commons module on the App Store. It can swap non ascii characters for their ascii equivalent.
Try the following (perhaps you need only one slash)