Hi @twister ,
You can use RegEx (Regular Expression) notation with one of the Match/MatchAll/IsMatch functions to match a pattern and manage the control behaviour that way - for example set the border color red, or set the submit button disabled/enabled depending on whether there is a match.
Try this on your button DisplayMode: property
If(
IsMatch( TextInput1.Text, Letter & Letter & Letter & Digit & "{7}"),
DisplayMode.Edit,
DisplayMode.Disabled
)
You can read more about regex syntax but it's a pretty abnormal kind of construct (unless you use linux and things like grep a lot 😁) - I certainly can't use it without reading up every time and using trial and error.
PowerApps tries to simplify it for you by replacing expressions with easier to read words like Digit and Letter - but you can use the more traditional (and harder to understand) syntax for more complex patterns. To demonstrate how you can use both methods in the same pattern, instead of repeating & Digit seven times above, I just dropped into the standard syntax and added "{7}" which is a quantifier expression for "the previous expression {n} times". I could also just have used
Letter & "{3}" & Digit & "{7}"
or some actual syntax (which I'm sure someone else can refine further or improve upon)
"[a-z]{3}\d{7}"
If you need to ensure it's uppercase, rather than forcing the user to retype it with a match and error, just convert it with Upper(TextInput.Text).
Hope this helps,
RT