re = /PAS_BEGIN_0009999(.*?)PAS_END_0009999/
str = 'PAS_BEGIN_0009999
T71_MANUFACTURER_4=98
T71_COLOR_ID_7=000
T71_OS_7=08
PAS_END_0009999
PAS_BEGIN_0009996
T72_VAS_SERVICE_IDENTIFIER_6=
T72_ORDER_NB_7=0003
T72_TECHNOLOGY_7=01
PAS_END_0009996
TPV_BEGIN
PAS_20819001=3600000
TPV_END'
# 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