re = /([[:space:]]+|^)areaIntegrate\(down\) of grad\(T\)y[[:space:]]+/m
str = '
Time = 0
Reading fields:
volScalarField: grad(T)y
Executing functionObjects
surfaceFieldValue patchIntegrate(name=down,grad(T)y) write:
total faces = 4000
total area = 5.286456431623655e-06
areaIntegrate(down) of grad(T)y = -0.3799414476287353
Space-averaged Nusselt lambda = 5.34607670341618
Time = 0.45
Reading fields:
volScalarField: grad(T)y
Executing functionObjects
surfaceFieldValue patchIntegrate(name=down,grad(T)y) write:
areaIntegrate(down) of grad(T)y = -0.6680860499604798
Space-averaged Nusselt lambda = 5.34607670341618'
# 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