re = /(?:(:\n\s))(?:\s|\n|(?:.(?!modern))*)*/m
str = 'js/modern/redux/actions/open-file-in-new-window.js:
8 import { openWindow, maybeSetVariantRedirectDomainQueryParam } from \'@slack/infra/multi-window\';
9: import getPrimaryView from \'@slack/redux/stores/workspace-store/get-primary-view\';
10 import { isGovSlack } from \'@slack/utility/is-gov-slack\';
26 const teamId = getTeamId(team);
27: const conversationId = getPrimaryView(state);
28 let fileUrl = teamId
js/modern/redux/actions/open-shortcuts-menu.js:
10 import looksLikeChannelId from \'@slack/utility/looks-like-channel-id\';
11: import getPrimaryView from \'@slack/redux/stores/workspace-store/get-primary-view\';
12 import jumpToMessage from \'@slack/redux/actions/jump-to-message\';
25 const state = getState();
26: const primaryViewId = getPrimaryView(state);
27 '
# 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