<p>I'm trying to get a regex that will match:</p>

<pre><code>somefile_1.txt
somefile_2.txt
somefile_{anything}.txt
</code></pre>

<p>but not match:</p>

<pre><code>somefile_16.txt
</code></pre>

<p>I tried</p>

<pre><code>somefile_[^(16)].txt
</code></pre>

<p>with no luck (it includes even the "16" record)</p>

Some regex libraries allow lookahead:
```
```
somefile(?!16\.txt$).*?\.txt
```
```
Otherwise, you can still use multiple character classes:
```
```
somefile([^1].|1[^6]|.|.{3,})\.txt
```
```
or, to achieve maximum portability:
```
```
somefile([^1].|1[^6]|.|....*)\.txt
```
```
```
[^(16)]
```
means: Match any character but braces, 1, and 6.