Question: There are a lot of ways to replace many characters with one.

```
s/a\{100\}/a/

```

Is there any way to replace it vice versa (one `a` with hundred `a`) without typing `a` 100 times?

ps. I use regexes in `sed`.

Answer: 
How about:

```
sed ':x;/a\{100\}/b;s/a/aa/;tx'

```
Not exactly as terse as you would like, but you could do something like this:

```
sed -e 's/a/aaaaaaaaaa/' -e 's/\(aaaaaaaaaa\)/\1\1\1\1\1\1\1\1\1\1/'

```

Basically replace the original `a` with 10 of them, then replace the sequence of 10 with 10 copies. For numbers other than 100, obviously, you'd factor it differently.