Here is the $regsubex() version if interested:
Code:
alias replace { echo -a output: $regsubex(test|-test|test2|-test2|txt,/(\55\w+)/Sg,$+(",\t,")) }
Or:
Code:
alias rep { $iif($isid,return,echo -a) $regsubex($1-,/(\55\w+)/Sg,$+(",\t,")) }
Then use:
Code:
/rep test|-test|test2|-test2|txt

or
Code:
//echo $rep(test|-test|test2|-test2|txt)

P.S. This also works for duplicate matches.