I want to get index of both times `ap` appears in the string `ASDAS ap ASDASD ap AS`. I tried

```
regexpr("ap", "ASDAS ap ASDASD ap AS")[1] 

```

But it only gives me the index of first match. How do I get index of both times the match for `ap` has been found?