>>>>> "J" == Jim Freeze <jim / freeze.org> writes: J> I don't know how to do that yet. J> I have just declared them as static in my .c file. But, maybe that J> doesn't matter. Something like this #include <ruby.h> static VALUE re_equal, re_space; static VALUE tt_sub_bang(VALUE line) { VALUE sp = rb_str_new2(" "); rb_funcall(line, rb_intern("gsub!"), 2, re_equal, sp) /* ... */ return line; } void Init_tt() { re_equal = rb_reg_regcomp(rb_str_new2("\\s*=\\s")); re_space = rb_reg_regcomp(rb_str_new2("\\s+")); /* register the variable */ rb_global_variable(&re_equal); rb_global_variable(&re_space); /* ... */ } Guy Decoux