I'm trying to remove all the spaces following / preceding single quotes from a datafile. However I'm not catching everything with the below scenario.

Input

```
{'_id':' BE3523 ', 'time':' 18:20 ', 'number':' BE3523 ', 'destination':' Bordeaux ', 'status': ' Scheduled '}

```

sed command I'm running...

```
sed -i.bak 's/['\'' ]\{2\}/'\''/g' input.json

```

Output

```
{'_id':'BE3523','time':'18:20','number':'BE3523','destination':'Bordeaux','status':' Scheduled'}

```

Note the space between `'_Scheduled` remains, but **every** other space has been removed. I have to run the sed command again to get rid of this final space for the below to be

```
{'_id':'BE3523','time':'18:20','number':'BE3523','destination':'Bordeaux','status':'Scheduled'}

```

Any ideas what I'm doing wrong and why this one space consistently remains?