The validating string parameter plugin contributes a new parameter type to Jenkins that supports regular expression validation of the user's entered parameter.This plugin is used wherever build parameter selection is available, most commonly in the job configuration page by enabling parameterized builds (this parameter type will also be available as release parameters using the release plugin).
The result of each string-validator function is a function that accepts the value to test and returns true or false.
This allows the resulting function to be used in places where a function that just takes a value is expected.
Did you noticed that I am providing char while creating the byte array.
It works because of autoboxing and char ‘P’ is being converted to 80 in byte array.
You should use two methods where each validates one type only.