I\'m trying to replace the content of some HTML tags in an HTML page using sed in a bash script. For some reason I\'m not getting the proper result as it\'s not replacing an
sed -i -e 's%([0-9]*)/'"${unlockedCount}/g" index.html
I removed the Useless Use of Cat, took out a bunch of unnecessary backslashes, added single quotes around the regex to protect it from shell expansion, and fixed the repetition operator. You might still need to backslash the grouping parentheses; my sed, at least, wants \(...\).
Note the use of single and double quotes next to each other. Single quotes protect against shell expansion, so you can't use them around "${unlockedCount}" where you do want the shell to interpolate the variable.