I have an XML document that has entries that contains URL, basically a Git / Bitbucket URL:
<value>
https://git...com/projects/.../..._config.json?raw&at=dev
</value>
So basically this URL points to the dev branch, and I want to replace it such that it points to master by removing the "&at=dev"
string.
How do I trim this using regex using the suffix "_config.json?raw"
as reference? Can you give both Python and bash script solution? How about when "at=dev"
is to be replaced with "at=release"
? (Please note that I cannot just replace all occurence of "dev"
as the word is too common, so I still need to use "_config.json?raw"
as regex reference)