pub(crate) fn get_captures(&mut self, captures: &Captures, given: &str) {
        //let id1 = IdentId::get_id("$&");
        //let id2 = IdentId::get_id("$'");
        match captures.get(0) {
            Some(m) => {
                self.sp_last_match = Some(given[m.start()..m.end()].to_string());
                self.sp_post_match = Some(given[m.end()..].to_string());
            }
            None => {
                self.sp_last_match = None;
                self.sp_post_match = None;
            }
        };

        self.sp_matches.clear();
        for i in 1..captures.len() {
            self.sp_matches.push(
                captures
                    .get(i)
                    .map(|m| given[m.start()..m.end()].to_string()),
            );
        }
    }
Save captured strings to special variables.
$n (n:0,1,2,3...) <- The string which matched with nth parenthesis in the last successful match.
$& <- The string which matched successfully at last.
$' <- The string after $&.
ruruby/src/vm/executor.rs