Frequent Contributor.. Le4vitt Frequent Contributor..
Frequent Contributor..

Restricting characters in userOption field

Hello all,

On an offering, we would like to limit the available characters for a user option. 

The user option has a string type, medium size. 

We would like to display an error message if the user uses anything else than alphanumeric characters (A-z,0,9), a "-" or a "_". 

We tried using an expression validation with a match pattern function but it seems a bit limited for what we want to do.

What could we use to get the expected results ?



2 Replies
Micro Focus Expert
Micro Focus Expert

Re: Restricting characters in userOption field


The validation is restricted to the match pattern function. For additional capabilities please submit an idea, but please make sure you describe the use case, not just the technical requirement (as in this case).

Best regards,


benwatt Super Contributor.
Super Contributor.

Re: Restricting characters in userOption field

Just came on here to ask the very same question having tried to get the match_pattern function to work for me too without success.

Happy to support your idea if you submit it, otherwise will raise it myself! Our use case is that we're asking user's to enter some text that will ultimately become part of a directory name, so certain special characters are not allowed.

Edit: Just found this similar idea: https://community.microfocus.com/t5/SMA-Idea-Exchange/Add-input-masking-for-custom-fields/idc-p/1767802

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.