Hello @wilfried1954
If you are using a “Single Line Text” field, you should to enter the regular expression to use for validation into the “Validate against a regular expression” attribute, and the error text to display if the validation fails into the attribute: “Error message when the regular expression fails”
In the following screenshot the regular expression validate the field’s values be digits only:
![](https://cdn.statically.io/img/wordpress.dwbooster.com/customdownloads/2020/05/23/single-line-text-settings.png)
Best regards.
Thank you!
Possible it benefit for others. So I put my solution here. This is the Regular expression needed for filenames in Windows. I still have to expand it a little for Linux, but as the limits are the most big for Windows, this should do at least for Windows users:
^(?!^(PRN|AUX|CLOCK\$|NUL|CON|COM\d|LPT\d|\..*)(\..+)?$)[^\x00-\x1f\\?*:\";|/]+$
Best regards, Wilfried
-
This reply was modified 4 years, 2 months ago by
wilfried1954.
Hello @wilfried1954
Thank you very much for sharing your regular expression.
Best regards.