Negative Lookbehind(?<!\\) \\the literal \ (9210 / 1348 / 5C16)
\[the literal [ (9110 / 1338 / 5B16)
Comment: ID within brackets
\^the literal ^ (9410 / 1368 / 5E16)
Comment: Make sure, this is not confused with a footnote
Group link_id(?<link_id>.+?) .+?any character (except for line terminators), repeated at least once
Negative Lookbehind(?<!\\) \\the literal \ (9210 / 1348 / 5C16)
\]the literal ] (9310 / 1358 / 5D16)
*matches any number of characters from the set below:
the literal (3210 / 408 / 2016)
\ta tab character (ASCII 9)
Comment: Possibly with some space before colon
\:the literal : (5810 / 728 / 3A16)
*matches any number of characters from the set below:
the literal (3210 / 408 / 2016)
\ta tab character (ASCII 9)
\n?optionally matches a line-feed (newline) character (ASCII 10)
*matches any number of characters from the set below:
the literal (3210 / 408 / 2016)
\ta tab character (ASCII 9)
Comment: Possibly with some space after the colon, possibly with a new line in between?
Non-Capturing Group(?:
<(?<link_url>[^\>]+)> # link within <>
|
(?<link_url>\S+) # or link without <>
) 1st Alternative
<(?<link_url>[^\>]+)> # link within <>
<the literal text <
Group link_url(?<link_url>[^\>]+) Negated Character Class[^\>]+ +matches at least one character outside the set below:
\>the literal > (6210 / 768 / 3E16)
Comment: link within <>
2nd Alternative
(?<link_url>\S+) # or link without <>
Group link_url(?<link_url>\S+) \S+any non-whitespace character, repeated at least once
Comment: or link without <>
Non-Capturing Group(?:
(?:
[ \t]+ # Either some space or tabs
|
[ \t]*\n[ \t]* # or a new line surrounded by 0 or more spaces or tabs
)
(?:
(?:
(?<link_title_container>['"]) # Title is surrounded ether by double or single quotes
(?<link_title>.+?)
\g{link_title_container} # make the sure enclosing mark balance
)
| # or
\((?<link_title>[^\)]+)\) # by parenthesis
)
)? ?repeats the group contents below at most once:
Non-Capturing Group(?:
[ \t]+ # Either some space or tabs
|
[ \t]*\n[ \t]* # or a new line surrounded by 0 or more spaces or tabs
) 1st Alternative
[ \t]+ # Either some space or tabs
+matches at least one character from the set below:
the literal (3210 / 408 / 2016)
\ta tab character (ASCII 9)
Comment: Either some space or tabs
2nd Alternative
[ \t]*\n[ \t]* # or a new line surrounded by 0 or more spaces or tabs
*matches any number of characters from the set below:
the literal (3210 / 408 / 2016)
\ta tab character (ASCII 9)
\na line-feed (newline) character (ASCII 10)
*matches any number of characters from the set below:
the literal (3210 / 408 / 2016)
\ta tab character (ASCII 9)
Comment: or a new line surrounded by 0 or more spaces or tabs
Non-Capturing Group(?:
(?:
(?<link_title_container>['"]) # Title is surrounded ether by double or single quotes
(?<link_title>.+?)
\g{link_title_container} # make the sure enclosing mark balance
)
| # or
\((?<link_title>[^\)]+)\) # by parenthesis
) 1st Alternative
(?:
(?<link_title_container>['"]) # Title is surrounded ether by double or single quotes
(?<link_title>.+?)
\g{link_title_container} # make the sure enclosing mark balance
)
Non-Capturing Group(?:
(?<link_title_container>['"]) # Title is surrounded ether by double or single quotes
(?<link_title>.+?)
\g{link_title_container} # make the sure enclosing mark balance
) Group link_title_container(?<link_title_container>['"]) Comment: Title is surrounded ether by double or single quotes
Group link_title(?<link_title>.+?) \g{link_title_container}the text saved by group link_title_container
Comment: make the sure enclosing mark balance
2nd Alternative # or
\((?<link_title>[^\)]+)\) # by parenthesis
Comment: Possibly ending with some trailing spaces or tab