If you work with strings in your Python scripts and you're writing obscure logic to process them, then you need to look into ...
$ tabgrab -h tabgrab: extract and restore URL tabs to and from the active browser window Usage: grab: extracts the URL from each tab of the active browser window tabs: opens the provided URLs as tabs ...