How to call a function in regex_replace with matches?
Use regexp_matches.  The output of capturing parentheses will be stuffed into an array slot and can be accessed from there. Each match of the entire pattern will generate one row, which you could re-aggregate if you wanted to.
SELECT concat_ws(' ',regexp_matches[1],regexp_matches[2]) 
   from regexp_matches( 'foobar[i:89]asdfasdf[s:12]llll[i:9]', 
                        '\[([is]?:?)(\d+)\]',
                        'gi'
                      );