投稿済み Wed, 08 Jul 2020 20:05:35 GMT 、投稿者 Steve Shriver Application Specialist
Has anyone ever created a field mask that will allow any characters but limit the entry?

A customer wants to allow only 20 characters in a text field. But it's a cloud system so there is no changing the DB itself.

I thought I had the expression right for any letter, digit, hyphen or space but now '/' and commas are required. Is there a wild card in RegEx?

Any clues appreciated,
投稿済み Thu, 09 Jul 2020 13:08:48 GMT 、投稿者 Josef Zayats
Steve, try this for length of 20
[\s\S]{20}
or this for range of lengths
[\s\S]{19,21}
投稿済み Thu, 09 Jul 2020 13:09:22 GMT 、投稿者 Steve Shriver Application Specialist
In case anyone is interested. This field mask will allow any character, 0 to 20 times. \s is white space and \S is non-white space.
[\s\S]{0,20}
投稿済み Thu, 09 Jul 2020 13:10:48 GMT 、投稿者 Steve Shriver Application Specialist

Josef, you're right of course. 

Thanks,

フォーラムに投稿するためにはログインが必要です。