You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: regex.rs
    path of file: ./repos/sn0int/src/runtime
    
    the code of the file until where you have to start completion: use crate::errors::*;

use crate::engine::ctx::State;
use crate::engine::structs::LuaList;
use crate::hlua::{self, AnyLuaValue};
use regex::{Regex, Captures};
use std::sync::Arc;


fn capture_to_lua(caps: &Captures) -> AnyLuaValue {
    let mut i = 0;
    let mut list = LuaList::new();
    while let Some(cap) = caps.get(i) {
        list.push_str(cap.as_st
    
    fn verify_find_all() {
        let script = Script::load_unchecked(r#"
        function run()
            m = regex_find_all(".(.)", "abcdef")

            if m[1][1] ~= 'ab' then
                return 'Incorrect result in m[1][1]'
            end

            if m[1][2] ~= 'b' then
                return 'Incorrect result in m[1][2]'
            end

            if m[2][1] ~= 'cd' then
                return 'Incorrect result in m[2][1]'
            end

            if m[2][2] ~= 'd' then
                return 'Incorrect result in m[2][2]'
            end

            if m[3][1] ~= 'ef' then
                return 'Incorrect result in m[3][1]'
            end

            if m[3][2] ~= 'f' then
                return 'Incorrect result in m[3][2]'
            end
        end
        "#).expect("Failed to load script");
        script.test().expect("Script failed");
    }