… | |
… | |
15 | qr{( |
15 | qr{( |
16 | (?:https?|ftp|news|mailto|file)://[ab-zA-Z0-9\-\@;\/?:&=%\$_.+!*\x27(),~]+ |
16 | (?:https?|ftp|news|mailto|file)://[ab-zA-Z0-9\-\@;\/?:&=%\$_.+!*\x27(),~]+ |
17 | [ab-zA-Z0-9\-\@;\/?:&=%\$_+!*\x27(),~] # do not include a trailing dot, its wrong too often |
17 | [ab-zA-Z0-9\-\@;\/?:&=%\$_+!*\x27(),~] # do not include a trailing dot, its wrong too often |
18 | )}x, |
18 | )}x, |
19 | |
19 | |
20 | # common forms of quoting |
20 | # common "parentheses" |
21 | qr{(?:^|\s) [‘`] ([^‘`’']+) [’'] (?:\s|$)}x, |
21 | qr{(?:^|\s) ‘ ([^‘’]+?) ’ (?:\s|$)}x, |
|
|
22 | qr{(?:^|\s) ` ([^`']+?) ' (?:\s|$)}x, |
|
|
23 | qr{ \{ ([^{}]+?) \} }x, |
|
|
24 | qr{ \[ ([^{}]+?) \] }x, |
22 | |
25 | |
23 | # shell-like argument quoting |
26 | # shell-like argument quoting, basically always matches |
24 | qr{\G [\ \t|&;<>()] *( |
27 | qr{\G [\ \t|&;<>()] *( |
25 | (?: |
28 | (?: |
26 | [^\\"'\ \t|&;<>()]+ |
29 | [^\\"'\ \t|&;<>()]+ |
27 | | \\. |
30 | | \\. |
28 | | " (?: [^\\"]+ | \\. )* " |
31 | | " (?: [^\\"]+ | \\. )* " |