[X] regular expressions not working correctly

It seems character classes [...] are not working in MP3Tag's implementation of regular expressions, as

$regexp(%_tag%,(ID3\w*).,$1) matches ID3v1
but
$regexp(%_tag%,(ID3[\w]).,$1) only matches ID3 (should match ID3v1)
$regexp(%_tag%,(ID3[^ ]).*,$1) only matches ID3 (should match ID3v1)

(%_tag% = "ID3v1 Lyrics3v2 ID3v2.4 APEv2")

Try this ...

$regexp(%_tag%,'(ID3\w*).*','$1') $regexp(%_tag%,'(ID3[\w]*).*','$1') $regexp(%_tag%,'(ID3[^ ]*).*','$1')

DD.20110720.0704.CEST

your version (with '...' wrapped around) works. what is the reason for this? Why are quotes (') needed at all?

I finally settled for $regexp(%_tag%,(ID3\S*).*,$1) which also works.

however \S and [^ ] is strictly the same thing, so both variants should work.

It is strictly not the same thing.
Character class \s contains spaces, tabs, and line breaks.
Character class \S is the negated version of class \s.

DD.20120118.1124.CET

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.