define colors by file type joker character

Please report only one bug per message!

Moderators: sheep, Hacker, Stefan2, white

Post Reply
spd
Junior Member
Junior Member
Posts: 7
Joined: 2011-12-18, 12:27 UTC

define colors by file type joker character

Post by *spd » 2012-03-15, 17:38 UTC

Hello! There is something strange around the "define colors by file type" function: as far as I know, a file extension mustn't have a dot. If I add to a color block something similar to *.r0* (rar slice), then the applied dot is not the last (which separates the extension), but the first occurrance, in order of the defined color blocks.

Sample color blocks:
*.exe -- brown
*.r0* -- green
*.jpg -- red
font color for unknown types: navy

result:
test.r01 -- green
test.r01.exe -- brown
test.r01.jpg -- green (jpg, should be red)
test.r01.xyz -- green (unknown file type, should be navy)

with *.r0? (instead of *.r0*) works fine:
test.r01 -- green
test.r01.exe -- brown
test.r01.jpg -- red
test.r01.xyz -- navy

I've found this in the v7.56a, so I updated to the new 7.57a, which works the same way.

User avatar
MVV
Power Member
Power Member
Posts: 8381
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2012-03-15, 17:58 UTC

Problem is that * matches any number of any characters including any number of dots. When you type mask *.r0*, it is unclear that this dot must be the last.

So you may use mask like *.r?;*.r??;*.r??? or template with regex pattern like \.r\d+$.
Last edited by MVV on 2012-03-22, 09:57 UTC, edited 2 times in total.

User avatar
white
Power Member
Power Member
Posts: 2020
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white » 2012-03-22, 08:18 UTC

MVV wrote:So you may use mask like ... or template with regex pattern like .*\.r\d+.
Add a "$" at the end to make it work. ;-)

User avatar
MVV
Power Member
Power Member
Posts: 8381
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2012-03-22, 09:52 UTC

white, you're right, that's better (I forgot that partial match works here instead of full one). And \.r\d+$ is the best. :)

Post Reply