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}”)
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.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs