I have a folder of csv files from an experiment that I want to read into R for analysis. The folder contains two files for every participant, with filenames following the pattern:

```
"participantID.csv"
"participantID_debrief.csv"

```

I want to create two variables in R, one for the standard data files and one for the debrief files. I have found the list.files function and see that the standard way to use this would be like:

```
files <- list.files(path="D:/data", pattern=".csv")

```

But I want to use the pattern parameter to match first only the filenames that **don't** end in "\_debrief.csv" and then only the ones that **do**. How would I write the regular expression (assuming that's what pattern is) to achieve this?