Question: I have series of plots looking like this:

python code:

```
a = np.array([4,4,4,4,5,5,5,6,6,6,6,6,6,6,7,7,7,8,8,8,9])
b = np.array([i/len(a) for i in range(1, len(a)+1)])
pl.plot(a,b, 'ro')

```

r code:

```
a <- c(4,4,4,4,5,5,5,6,6,6,6,6,6,6,7,7,7,8,8,8,9)
b <- seq(0,1,length = length(a))
plot(a, b, col = "red")

```

[![imge](https://i.stack.imgur.com/DTseP.png)](https://i.stack.imgur.com/DTseP.png)

For some purpose I need to fit this points with best cumulative distribution function (CDF) of gamma distribution. Is there any way how to do this numerically in python or R? I am using winpython so i can import R code pretty straightfoward. 

PS: I found [this](https://stat.ethz.ch/pipermail/r-help/2007-February/126408.html) post but I dont understant it.

Answer: 
You can achieve this with `replace()` alone using the correct RegEx with group captures. Try this:

```js
var _string = "split and replace @123/0 and test @456/1 and so on...";
_string = _string.replace(/(@\d{3})\/(\d)/g, "$1.00/$2");
console.log(_string);
```
```
var _string  = "split and replace @123/0 and test @456/1 and so on...".replace("@123/0", "@123.00/0").replace("@456/1", "@456.00/0"); 

```

Try this