# coding=utf8
# the above tag defines encoding for this document and is for Python 2.x compatibility
import re
regex = r"(?:github.com)(.*)"
test_str = ("# [JSBox ](https://github.com/axelburks/JSBox?files=1) script\n"
"/\n"
" [Extract Scheme](https://github.com/axelburks/JSBox/tree/master/Extract%20Scheme) \n"
" [over 1 year ago](https://github.com/axelburks/JSBox/tree/master/Extract%20Scheme) [Launcher](https://github.com/axelburks/JSBox/tree/master/Launcher) \n"
" [over 1 year ago](https://github.com/axelburks/JSBox/tree/master/Launcher) [Magic Launcher](https://github.com/axelburks/JSBox/tree/master/Magic%20Launcher) \n"
" [8 months ago](https://github.com/axelburks/JSBox/tree/master/Magic%20Launcher) [Schedule Message](https://github.com/axelburks/JSBox/tree/master/Schedule%20Message) \n"
" [over 1 year ago](https://github.com/axelburks/JSBox/tree/master/Schedule%20Message) [XPin](https://github.com/axelburks/JSBox/tree/master/XPin) \n"
" [3 days ago](https://github.com/axelburks/JSBox/tree/master/XPin) [iTunes Utilities](https://github.com/axelburks/JSBox/tree/master/iTunes%20Utilities) \n"
" [6 months ago](https://github.com/axelburks/JSBox/tree/master/iTunes%20Utilities) [Boom.js](https://github.com/axelburks/JSBox/blob/master/Boom.js) \n"
" [almost 2 years ago](https://github.com/axelburks/JSBox/blob/master/Boom.js) [Clip Editor.js](https://github.com/axelburks/JSBox/blob/master/Clip%20Editor.js) \n"
" [about 1 year ago](https://github.com/axelburks/JSBox/blob/master/Clip%20Editor.js) [Downloader.js](https://github.com/axelburks/JSBox/blob/master/Downloader.js) \n"
" [over 1 year ago](https://github.com/axelburks/JSBox/blob/master/Downloader.js) [Emoji.js](https://github.com/axelburks/JSBox/blob/master/Emoji.js) \n"
" [almost 2 years ago](https://github.com/axelburks/JSBox/blob/master/Emoji.js) [IPA Installer.js](https://github.com/axelburks/JSBox/blob/master/IPA%20Installer.js) \n"
" [about 2 months ago](https://github.com/axelburks/JSBox/blob/master/IPA%20Installer.js) [Installer.js](https://github.com/axelburks/JSBox/blob/master/Installer.js) \n"
" [over 1 year ago](https://github.com/axelburks/JSBox/blob/master/Installer.js) [Pushbullet.js](https://github.com/axelburks/JSBox/blob/master/Pushbullet.js) \n"
" [about 1 year ago](https://github.com/axelburks/JSBox/blob/master/Pushbullet.js) [README.md](https://github.com/axelburks/JSBox/blob/master/README.md) \n"
" [about 2 months ago](https://github.com/axelburks/JSBox/blob/master/README.md) [SM.MS.js](https://github.com/axelburks/JSBox/blob/master/SM.MS.js) \n"
" [over 1 year ago](https://github.com/axelburks/JSBox/blob/master/SM.MS.js) [Shorten.js](https://github.com/axelburks/JSBox/blob/master/Shorten.js) \n"
" [about 1 year ago](https://github.com/axelburks/JSBox/blob/master/Shorten.js) [Thunder.js](https://github.com/axelburks/JSBox/blob/master/Thunder.js) \n"
" [about 1 year ago](https://github.com/axelburks/JSBox/blob/master/Thunder.js) [Tool Box play_icon.png](https://github.com/axelburks/JSBox/blob/master/Tool%20Box%20play_icon.png) \n"
" [almost 2 years ago](https://github.com/axelburks/JSBox/blob/master/Tool%20Box%20play_icon.png) [Tool Box.js](https://github.com/axelburks/JSBox/blob/master/Tool%20Box.js) \n"
" [over 1 year ago](https://github.com/axelburks/JSBox/blob/master/Tool%20Box.js) [Weico.js](https://github.com/axelburks/JSBox/blob/master/Weico.js) \n"
" [almost 2 years ago](https://github.com/axelburks/JSBox/blob/master/Weico.js) [XQRcode.js](https://github.com/axelburks/JSBox/blob/master/XQRcode.js) \n"
" [about 1 year ago](https://github.com/axelburks/JSBox/blob/master/XQRcode.js) [updateInfo](https://github.com/axelburks/JSBox/blob/master/updateInfo) \n"
" [over 1 year ago](https://github.com/axelburks/JSBox/blob/master/updateInfo) [version.json](https://github.com/axelburks/JSBox/blob/master/version.json) \n"
" [about 2 months ago](https://github.com/axelburks/JSBox/blob/master/version.json) ")
subst = ""
# You can manually specify the number of replacements by changing the 4th argument
result = re.sub(regex, subst, test_str, 0, re.MULTILINE)
if result:
print (result)
# Note: for Python 2.7 compatibility, use ur"" to prefix the regex and u"" to prefix the test string and substitution.
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Python, please visit: https://docs.python.org/3/library/re.html