Can we fetch the validation attribute in the custom error message?

hey everyone, I am now practicing validation library react-hook-form and I wanted to know if there’s a way we can put the dynamic limit of char which we have put in the validation into the custom error text we write to display as an error?