From: Jim Freeze Date: 2003-04-15T00:12:39+09:00 Subject: Re: How do I call a regex from C? On Tuesday, 15 April 2003 at 0:06:08 +0900, ts wrote: > >>>>> "J" == Jim Freeze writes: > > J> // I don't think this is allowed -------v > J> rb_funcall(line, "gsub!", 2, re_equal, "=") > > not allowed : you must give only VALUE > > J> // should probably be this. > J> rb_funcall(line, "gsub!", 2, re_equal, sp) > > yes, this must work if you replace "gsub!" with rb_intern("gsub!") > > J> What if I want to replace with an empty string ""? > > rb_str_new2("") > Cool. Ok, I can do all that. However, the following aborts: re_equal = rb_reg_regcomp("\\s*=\\s"); re_space = rb_reg_regcomp("\\s+"); -- Jim Freeze ---------- Fourth Law of Revision: It is usually impractical to worry beforehand about interferences -- if you have none, someone will make one for you.