#!/bin/bash
s='[Royal Enfield Flying Flea](RE Flying Flea)
[Some string here](another string there)'
sed -E ':a;s/(\[[^][]*]\([^()[:space:]]*)[[:space:]]([^()]*\))/\1%20\2/;ta' <<< "$s"
