Custom rules can be defined as a function and given as a rule definition.
Validation Result: valid
Current Rules
[
{
"path": "val",
"ruleSet": [
"required",
{
"rule": e=>{let{value:r}=e;return r&&(!r.includes("g")||r.length<5)?"this field should include letter `g` and its length should be greater than 5":null}
}
]
}
]