Input masking

In version V2 of Filament, I had this mask:

->mask(fn (TextInput\Mask $mask) => $mask->pattern('{{ /^[0-9kK]*$/ }}'))

But how can I achieve the same thing in the new version using the regular expression? I'm not sure why this expression doesn't work:

->mask(RawJs::make(<<<'JS'
    return '/^[0-9kK]*$/'
JS))

Could you please help me with this?
Was this page helpful?