re = /modified:\s+((?>\w+\/?)+)[^)\v]*\)/
str = ' modified: apps/aaaaaa/bbbbbb/ccccff
modified: apps/ami (new commits)
modified: apps/assess (new commits)
modified: apps/ees121 (new commits)
modified: apps/energy_bourse (new commits)
modified: apps/gis (new commits)
modified: apps/hse (new commits)
modified: apps/aa/aaa/a/bb/b/bb/bc/c22/s/df/s/
modified: apps/management (new commits)
modified: apps/payesh (new commits)
modified: external_apps (modified content)
modified: modules/esb_server (new commits)
modified: modules/formbuilder (new commits, modified content)
modified: modules/reporting (new commits)
modified: modules/safir (new commits)
modified: modules/workflow (new commits)
modified: vendor/raya_framework/client (new commits)
modified: vendor/raya_framework/core (new commits)'
# 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