From: Robert Klemme Date: 2009-11-16T16:40:07+09:00 Subject: Re: replace a very long string with gsub get regexp error On 15.11.2009 23:47, Ahmad Azizan wrote: > Robert Klemme wrote: >> On 15.11.2009 21:44, Ahmad Azizan wrote: >>> input = input.gsub(data, lala) >>> >>> Is there any other method for that string replacement like in this case >>> beside using gsub? >> And your problem is? > > Sorry for incomplete question. > > The problem is that, because of the very long string length, the gsub > return a regexp error indicating that the regular expression is too > long. Ahmad, it's easier for us if you present a complete example along with the concrete error (e.g. exception with stack trace). A general remark: it is very uncommon to have a regular expression whose text is 80k in size. So you probably rather want a different approach but which one is difficult to tell without having more input. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/