This is a very simple set-up to show the concept only. You can integrate this concept into your own app however you see fit.
1. Add a Text Input control on a page (named TextInput1)
2. Add a label control on your page
3. On the label text property add your error message "Input must be in the format xxx-xxx-xxxx"
4. On the label Visible property, add the formula:
!IsMatch(TextInput1.Text, "^\d{3}-\d{3}-\d{4}$")
This formula is evaluating the inputted text is in the desired format you specified (only digits, in the xxx-xxx-xxxx format). It does this using whats called a regex expression. Regex allows you to specify a alphanumeric pattern you want the user adhere to. The visible property expects the evaluation of the formula to evaluate to either true or false. In this case, if the pattern matches, we want the error message to be hidden visible, so it evaluates to false (thus the !)
5. Play your app, when a user enter any value in the Text input control that is not in the format of xxx-xxx-xxxx, it will display the error label text, otherwise the label is not visible.