I've a directory with tons of files and I want only to get the names of the ones starting with `sly_`.

If I'm not wrong, the patter for this is `^sly_`.

This is my try using the solution of [this](https://stackoverflow.com/a/1601327/742269) question:

```
    string pattern = @"^sly_";
    var matches = Directory.GetFiles(@"D:\mypath").Where(path => Regex.Match(path, pattern).Success);

    foreach (string file in matches)
        Console.Write(file); 

```

Unfortunatelly, this doesn't list the files matching my pattern. So, can someone tell me what's wrong with me code and how can I list the file names starting with `sly_`?

Thanks in advance.