I need to recognize URLs including also square brackets (as I have real URLs with square brackets), like:
(this is a made-up example, similar to a real one)
I tried multiple options, including the simple option of adding in the same way as () is added in the solution proposed at https://github.com/atom/language-hyperlink/pull/13/files (https://github.com/atom/language-hyperlink/pull/13):
match: "(?x)\\b(https?|thunderlink|cbthunderlink|imap-message|mailbox-message|s?ftp|ftps|file|smb|afp|nfs|(?:x-)?man(?:-page)?|gopher|txmt|issue)://((?!(\\#[[:word:]]*\\#))(?:[-:@[:word:].~%$+_/?=&#;|!()]))+(?<![-.,?:#;])" name: "markup.underline.link.$1.hyperlink"
But there is no way to make it work. I tried many other options (including regular expressions with OR |, using escape characters, etc.). Should this work? Is it possible to define this?
I have also noticed a strange thing: even if I try the original expression in a regular expression tester like the one available at https://regex101.com/ I obtain errors (even though the original expression works in Atom).
Any idea would be welcome.