re = /(^[A-Z0-9\&\'s\-\040]{2,})\040/
str = 'PANTENE Pro-v acondicionador aqua light cabello fino bote 300 ml
GALLINA BLANCA sopa
COCA-COLA Orxata de la terreta
M&M\'s saco cacahuete bolsa 220 gr
MAHOU 5 ESTRELLAS Cervesa
CVNE CARO Vino tinto reserva DO Rioja botella 75 cl"
MARCA BLANCA bombones
COCA COLA Clásica botella 1.5 lt"'
# 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