I want to use gsub to correct some names that are in my data. I want names such as "R. J." and "A. J." to have no space between the letters.

For example:

```
x <- "A. J. Burnett"

```

I want to use gsub to match the pattern of his first name, and then remove the space:

```
gsub("[A-Z]\\.\\s[A-Z]\\.", "[A-Z]\\.[A-Z]\\.", x)

```

But I get:

```
[1] "[A-Z].[A-Z]. Burnett"

```

Obviously, instead of the [A-Z]'s I want the actual letters in the original name. How can I do this?