On Mon, Apr 14, 2003 at 11:56:45PM +0900, Jim Freeze wrote: > > To create a regexp you have also rb_reg_regcomp(VALUE). You can use > > perhaps also rb_reg_match() > > > > > > Guy Decoux > > Ok, this is what I have done so far: > > static VALUE re_equal; > > in_some_init_func() { > re_equal = rb_reg_regcomp("\\s*=\\s"); > re_space = rb_reg_regcomp("\\s+"); > } The argument to rb_reg_regcomp is a VALUE, not a C null-terminated string. > If I just want to replace with a character, is there > a faster way than to create a string object? If you create string objects at initialisation time then you don't have to worry about the overhead, just use them when required. B.