Best method for extracting text from a longer text in Ruby


#1

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


#2

Look at String#split or some of the Regexp methods. You’ll probably
find something that will work for you.

-Rob

Rob B. http://agileconsultingllc.com
removed_email_address@domain.invalid
+1 513-295-4739