I have a regex that removes everything but numbers, and I need something similar that keeps the last character and removes everything else. I tried searching it on Google but nothing showed up.

Example:

```
user
user

```

to just

```
r
r

```