Matthew Nova
2006-Apr-02 01:07 UTC
[Rails] Best method for extracting text from a longer text in Ruby
Hi Guys, I need to extract a text string from a longer text string. Both strings are variable in length and the text to extract is always between recognizable characters or tags (or the text to extract is from a known distance from said tags). I''m not an expert at text manipulation in ruby so it would be great if someone could recommend the best solution. I''m looking at the docs right now and I''m dying to know what''s the best method and/or if there is another one to avoid before I start coding ;-). Thanks, --Matt -- Posted via http://www.ruby-forum.com/.
Rob Biedenharn
2006-Apr-02 05:17 UTC
[Rails] Best method for extracting text from a longer text in Ruby
Look at String#split or some of the Regexp methods. You''ll probably find something that will work for you. -Rob Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com +1 513-295-4739 On Apr 1, 2006, at 8:07 PM, Matthew Nova wrote:> Hi Guys, > > I need to extract a text string from a longer text string. Both > strings > are variable in length and the text to extract is always between > recognizable characters or tags (or the text to extract is from a > known > distance from said tags). > > I''m not an expert at text manipulation in ruby so it would be great if > someone could recommend the best solution. I''m looking at the docs > right > now and I''m dying to know what''s the best method and/or if there is > another one to avoid before I start coding ;-). > > Thanks, > --Matt > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails