Skip to main content
Question

Regular expressions in field input masks

  • August 27, 2025
  • 6 replies
  • 161 views
  • Translate All

Tony Lanzer
Captain II
Forum|alt.badge.img+3

Can standard regular expressions actually be used as an input mask for PXTextEdit or PXMaskEdit UI controls as this article states?

https://help.acumatica.com/(W(17))/Help?ScreenId=ShowWiki&pageid=9b12bbba-a619-43e4-8335-11ffff13573b

If so, can someone point me to an example? Setting the input mask to anything other than basic Acumatica mask characters as shown in the article below results in the regex string showing in the field itself.

https://help-2022r2.acumatica.com/(W(2))/Help?ScreenId=ShowWiki&pageid=9bec9bb3-3363-4649-948f-7a55e9c048a1

6 replies

darylbowman
Captain II
Forum|alt.badge.img+17

What regex format did you try? Some formats start with different indicators (I think).

Translate

Tony Lanzer
Captain II
Forum|alt.badge.img+3

Something very simple like [\w\\-]*.  I understand there are different versions supported by different tools and languages, but this is pretty basic.  I can’t find any guidelines, or examples used in the framework either.  That’s why I’m asking for a working example - any example.

Translate

darylbowman
Captain II
Forum|alt.badge.img+17

I can’t find any either, but it seems like the expression would need to start with ^. Did you try that?

Reading through that article again, I’m not sure the Regular Expressions section has any logical connection to the Input Mask section, except that they are both forms of input validation.

Translate

Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • September 26, 2025

Hi ​@Tony Lanzer were you able to find a solution? Thank you!

Translate

Forum|alt.badge.img

Acumatica does not go out of its way to document the regular expression engine. Acumatica is built on a .NET framework so looking at .NET regular expression standards appears to be a naturally good starting point, https://learn.microsoft.com/en-us/dotnet/standard/base-types/regular-expressions. 

 

 

Translate

Forum|alt.badge.img+1

Hi ​@Tony Lanzer 

The two articles you linked are documenting separate features that just sit near each other. The Input Mask reference is placeholder-character based only (0/9/# digit, L/? letter, A/a letter-or-digit, C/& any char, > / < case) - there’s no regex engine behind InputMask, so [\w\-]* is taken literally and echoes back into the field. The “Examples of Masks and Regular Expressions” page lists masks and regex together, but as two independent validation tools, not regex-as-a-mask.

For regex validation, use it where that page actually applies it: the Reg. Exp. field on an Attribute / input validation setup - and those are JS-style, slash-delimited (e.g. /^\d{5}([-]\d\d)?$/;), not .NET. If you’d rather keep it in code, do it in FieldVerifying and throw a PXSetPropertyException on no match - that path is standard C# .NET regex.

Translate