See Original text in context
method orig()
Returns the original input to the regex engine, which is usually a string, but doesn't need to be (could be anything that can be coerced to a string):
42 ~~ /.+/;say $/.orig; # OUTPUT: «42»say $/.orig.^name; # OUTPUT: «Int»
See #method target for a close equivalent that always returns a string.