HomePhabricator

textlib.py: Rewrite FILE_LINK_REGEX to use atomic groups

Authored by Dalba on Mar 31 2018, 2:54 PM.

Description

textlib.py: Rewrite FILE_LINK_REGEX to use atomic groups

Python's re engine does not support atomic grouping, mimic the
behaviour using positive lookaheads and capturing groups.[1]

[1]: See http://www.rexegg.com/regex-tricks.html#pseudo-atomic-groups

Bug: T191113
Change-Id: I2eba916d0a171487d14396a3e785b3b253b827f1