# If you'd like to omit non-matching lines from the result; add ';d' to the end of the expression.
sed -E 's/(?<!(?:\\{2})*\\)(?:(?<begin_capture>[\(])(?<begin_capture_modifier>(?=[<][a-z_A-Z]+[>])|(?!\?(?:<?[=!]|:)))|(?<begin_non_capture>\((?=\?(?:<?[=!]|:))))|(?:(?<end>\)))/\n - $begin_capture/gm;t' <<< "// Basic - Repeat Delimiters
/^((?:([gimsuy])(?!.*\\2))*)/gm
// Basic - Nested - Captured | Non-captured
^(?:(// +)(?:(@noframes)([ \t]*$)|(@(?:include|match|grant|require))([\t ]+)(?:(https?.+?)|(.+))(\**)([ \t]*)|(^//[ \t]+)(@(?:author|name(?:space)?|version|description))([ \t]+)(.+?)([ \t]*)|(^//[ \t]+)(@resource)([ \t]+)(\S+)([ \t]+)(\S+)([ \t]*))(\n(?://[ \t]*\n)*))
// Basic - Captured | Non-captured | Lookbehind Positive
(?<=^[ \t]*)(//)([ ])(?<capture_name>)(Case:)([ \t]+)(.*\S)([ \t]*)?$
// Complex
(?<=^[ \t]*)(//)([ ])(Case:)([ \t]+)(.*\S)([ \t]*)?$"
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 SED, please visit: https://www.gnu.org/software/sed/manual/html_node/The-_0022s_0022-Command.html