 <p>The thing is that character classes treat characters inside them as individual characters, unless when using a range. So, what:</p> <pre><code>[2, 3, 4, 5, 8, 9, 10, 18, 19] </code></pre> <p>Will match is: <code>2</code>, <code>,</code>, , <code>3</code>, <code>,</code> (again), [...], <code>1</code>, <code>9</code>, <code>,</code> (again), , <code>1</code> (again), etc.</p> <p>What the regex has to look like is actually:</p> <pre><code>proxy.setFilterRegExp(QRegExp('^(2|3|4|5|8|9|10|18|19)$')) </code></pre> <p>Or shortened as much as possible:</p> <pre><code>proxy.setFilterRegExp(QRegExp('^([234589]|1[089])$')) </code></pre> <p>I guess you will have to change how <code>sourceModel.wantedNumbersList()</code> appears (some string manipulations) or input it manually.</p> <p>If you do it via string manipulation, I would suggest stripping the square brackets and replace the comma followed by space by a pipe <code>|</code>, then use <code>'^(%s)$'</code> for regex.</p>