Regexp pre_match

I looked in ruby documentation

I cannot find a method called pre_match but its used in Rails...

@template.instance_variable_get("@#{Regexp.last_match.pre_match}")

yep, last_match returns a MatchData object, which contains some wrapper methods, including a string of the last successful pattern match. Hence, pre_match would fall under MatchData, not Regexp.