define colors by file type joker character

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

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 »

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: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

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: 4594
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

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: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

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