Question: I would like to get all the files in a directory *without* a given extension. To get them with that extension is quite simple:

```
FileNames["*.<myExt>", myDir]

```

But instead I want everything *except* `"*.<myExt>"` and for reasons beyond the purview of this question I can't just post-process.

So what should I do?

Answer: 
Actually your problem can be solved in a straightforward way using [Negative Lookbehind After the Match](https://www.rexegg.com/regex-disambiguation.html#negative-lookbehind) assertion with [End of String](https://www.rexegg.com/regex-anchors.html#dollar) anchor. Note however that PCRE supports only fixed-length lookbehind, so you can't exclude a list of extensions with different lengths *using only one lookbehind assertion*. The solution is to include separate assertion for every extension.

I also think that the restriction `[^\\.]` in your regex is superfluous (unless you really wish to exclude filenames containing the dot `\\.` *before* the extension's dot). 

Here is an example regex excluding only filenames with `n` extension (but including `nb`, `nbp` etc. and also filenames without extension):

```
RegularExpression[".+(?<!\\.n)$"]

```

And here is an example regex excluding only filenames with `n` and `nb` extensions (but including `nbp`, `png` etc. and also filenames without extension):

```
RegularExpression[".+(?<!\\.n)(?<!\\.nb)$"]

```

---

The same problem can be solved using string patterns. 

Here is a `StringExpression` which excludes only filenames with extension `n` (i.e. includes `nb`, `nbp` etc. and also filenames without extension):

```
name__ ~~ EndOfString /; StringTake[name, -2] =!= ".n"

```

And here is a version which excludes only filenames with extensions `n` and `nb`:

```
name__ ~~ EndOfString /;
 StringTake[name, -2] =!= ".n" &&
  StringTake[name, -3] =!= ".nb"

```

Another version:

```
name__ ~~ EndOfString /; ! MatchQ[FileExtension[name], "n" | "nb"]

```
How about simply

```
Complement[FileNames["*",myDir], FileNames["*.<myExt>",myDir]]

```

Or would you call this "post-processing"?