my_string="blablablabla<coordinates>substring</coordinates>blabla" #the parentheses below define the actual match for the overall regex pattern sub_string = /.*<coordinates>(.*)<\/coordinates>.*/.match(my_string) puts sub_string[0]
Regex is the fastest/most effective for one/off text parsing. Another good option is Whytheluckystiff's Hpricot: http://code.whytheluckystiff.net/hpricot/ Hank --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

