From: Ahmad Azizan Date: 2009-11-18T04:35:28+09:00 Subject: Re: replace a very long string with gsub get regexp error Robert Klemme wrote: > On 15.11.2009 23:47, Ahmad Azizan wrote: >> 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 Yup. I know. By showing the code, I just really don' know where to start. But after looking at candlerb's option, it is what I really needed, the starting and ending index of the string really help marking the certain content in the string. I can go on from that. Thanks so much for sharing -- Posted via http://www.ruby-forum.com/.