From: Shadowfirebird Date: 2011-03-01T19:31:36+09:00 Subject: Re: Automatic question generator libs in Ruby Language > i want to get all the possible question from that paragraph Do you mean that you want to extract all the sentences that end in a question mark? Untested (so don't laugh, all you Ruby grownups): def questions(para) ans = [] para.split(/[\.\?\!] /).each do |sn| ans << sn if sn ~= /\? $/ end return ans end (That won't cope with brackets.) Said the Vicar: "Or quotes." But it's a starting point -- assuming that that was what you meant. Presumably someone smarter than me could do better with a single regex. -- This is a test of the Emergency Broadcast System. If this had been an actual emergency, do you really think we'd stick around to tell you?