I need regular expression to replace all matching characters except the first one in a squence in string.
For example;
For matching with 'A' and replacing with 'B'
'AAA' should be replaced with 'ABB'
'AAA AAA' should be replaced with 'ABB ABB'
For matching with ' ' and replacing with 'X'
- '[space][space][space]A[space][space][space]' should be replaced with '[space]XXA[space]XX'