re = /\bCourt\h+(?:Case\h+Fee|Filing Fee:)\h+(?:Contract\h+)?\$\K\d+\.\d+/mi
str = 'Court Case Fee $214.00 Payment Service Fee $6.91 E-File Fee $25.00
Court Filing Fee: Contract $198.00eFiling Fee $30.00Convenience Fee $8.28Total $236.28'
# 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