My string is like
5blog5sett5ings5[5slider5][5][5ima5ge5]
I like to match any digit into second brackets from end by regular expression.
For this case, my target digit is 5 into [5].
I like to select where before pattern like
5blog5sett5ings5[5slider5][ and after pattern like ][5ima5ge5]
I will use it for JavaScript string replace. Text can be different but the before and after patterns are like that. For better understanding see the image.
I tried something like
(?<=.+[.+?][)\d(?=][.+?])
but did not work.

\d+(?=]\[[^\]]*]$)