re = /(?<=\)\s).*/m
str = 'Alonso (2000) El papel del lenguaje interior en la regulación del comportamiento
Azcoaga (1988) El papel del lenguaje interno en el proceso de conocimiento
Caramazza (1989) On drawing inferences about the Structure of Normal Cognitive Sysytems'
# Print the match result
str.scan(re) do |match|
puts match.to_s
end
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Ruby, please visit: http://ruby-doc.org/core-2.2.0/Regexp.html