I'm looking for solution (Java) to replace the initial occurrences of multiple character with the same number of other character, for example if 'a' should be replaced with '-', than I expect:

```
aaabbaa  -> ---bbaa
aaxxaab  -> --xxaab
xaaaaax  -> xaaaaax

```

I've tried something like:

```
"aaabbaa".replaceAll( "^[a]+", "-")        // -bbaa
"aaabbaa".replaceAll( "(?=^[a]+)", "-")    // -aaabbaa

```

If possible, I prefer regex or oneliner.

Do you have any hints?

regards,
Annie