<p>I am making a mp3 id3tag editor, and a regex is not matching.
Could anyone help me please?
my code:</p>

<pre><code>arquivo = "[coletanea] album [CD #] [faixa] [artista] musica.mp3"

r = New Regex("^\[(?&lt;1&gt;[^\]]+?)\]\s*(?&lt;2&gt;[\w\s]+)\s*\[CD\s*(?&lt;3&gt;\d+)\]\s*\[(?&lt;4&gt;\d+)\]\s*\[(?&lt;5&gt;[^\]]+)\]\s*(?&lt;6&gt;.+)", RegexOptions.Compiled)
m = r.Match(Mid(arquivo, 1, Len(arquivo) - 4))
        If m.Success Then
            mAuthor = Trim(m.Groups(5).ToString)
            mWM_AlbumTitle = Trim(m.Groups(2).ToString)
            mWM_TrackNumber = Trim(m.Groups(4).ToString)
            mTitle = Trim(m.Groups(6).ToString)
            mWM_PartOfSet = Trim(m.Groups(3).ToString)
            mMW_AlbumArtist = Trim(m.Groups(1).ToString)
        End If
</code></pre>

That's because your string will never match the regexp you are using.
The regexp expects a number instead of # and a number instead of 'faixa'
Try this, for example:
```
```
"[coletanea] album [CD 20] [89] [artista] musica.mp3"
```
```
If you wish to allow for any character instead of just numbers, replace \d for . in the groups 3 and 4