I quite desperate with the following problem. I am trying to modify hyperlink.cson grammar file (https://github.com/atom/language-hyperlink/blob/master/grammars/hyperlink.cson) in order to recognize squared brackets in URLs; e.g., URLs such as http://aaa.com[fsdf]. I already modified it successfully to recognize normal parenthesis such as http://aaa.com(fsdf). However, I cannot make it work with the brackets. For example, I tried with the following expression:
match: \b((https?|thunderlink|cbthunderlink|imap-message|mailbox-message|s?ftp|ftps|file|smb|afp|nfs|(?:x-)?man(?:-page)?|gopher|txmt|issue):\/\/| (www.))((?!(\\#[[:word:]]*\\#))(?:[-:@[:word:].~%$+_\/?=&#;\|\!\(\)\[\]]))+(?<![-.,?:#;])
This expression works perfectly well in https://regex101.com but it does not work at all in Atom. Indeed, the expression without the part
\[\] seems to work but after adding it (to try to recognize square brackets) all the highlights stop working.
I even tried with a simpler expression, which just tries to recognize
but this does not work either.
I’ve spent a lot of time with this and I cannot find the solution. Maybe I am missing something. Any idea is very welcome.