You can validate the input using Validation, type custom.
Where you vallidate the attribute using an expression.
Expression isMatch with a regex checking for your desired format
https://docs.mendix.com/refguide/string-function-calls/#isMatch
The format of your regex... Thats up to you or use something like https://regexlib.com/
You may be better using a regular expression with the isMatch function. Try the following...
isMatch($YourString, 'R([0-9]+)')
That should match a string starting with R, followed by one or more digits.
https://docs.mendix.com/refguide/string-function-calls/#isMatch
I hope this helps.