How to write Validation Logic for user input required with 3 digits, then hyphen, then 8 digits

Hi ,

I have requirement to implement a validation logic for Text field.

The field should accept the mentioned format, first three should be digits, then Hypen, then 8 digits numeric.

otherwise error should be thrown.

example:- 123-12345678

Could you help with java code required to implement this in edit validate rule.

@JANAKIRAMA Can you try the below code

@BhanuPrakash_G It worked , Thank you.

Also , there is small enhancement request in this scenario along with validation.

For the same scenario, The Hypen should pop up automatically after first three digits. Any idea on how can we do this using Edit input rule, Could you share edit input code if you have any idea.

Thank you,