Need help with Regexp in file types dialog
Moderators: Hacker, petermad, Stefan2, white
Need help with Regexp in file types dialog
"Specify file type, e.g. *.txt, or RegEx with leading '<', like <(a|b)"
I try to write Regex for file type consist of e.g. *.xls and *.doc, but no luck.
Could somebody help me?
PS I'm sorry for my ugly English ...
I try to write Regex for file type consist of e.g. *.xls and *.doc, but no luck.
Could somebody help me?
PS I'm sorry for my ugly English ...
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
#259941, TC 11.01 x64, Windows 7 SP1 x64
2Stefan2
A want to understand how to use regexp here. This two types I gave for example. Could you to write example for me?
BTW Thank you for answer *.xls ;*.doc. I'll use it in suitable cases
A want to understand how to use regexp here. This two types I gave for example. Could you to write example for me?
BTW Thank you for answer *.xls ;*.doc. I'll use it in suitable cases

It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
#259941, TC 11.01 x64, Windows 7 SP1 x64
Regular Expressions inside TotalCommander
Well, just take a RegEx Tutorial and then use RegEx, but we two TC specialties:
1) prefix the RegEx by an '<'
2) the use of leading and trailing '.*' seems not needed here.
E.g. in TC folder
- press NumPad "+" key
- enter '<\d' to select every file with at least one digit in it
\d is the regex here
- or enter '<tcm' to select those files
tcm is the regex here
- or '<dll|exe' to select *.DLL and *.Exe files
'dll | exe' is the regex here
Perhaps from more use:
<(32|64).exe
Will select every file like 'xxxx32.exe' and 'xxxx64.exe'
Again, the normally needed '.*' in front is not needed here in TC.
The normal expression outside of TC would be '.+(32|64).exe'
.
1) prefix the RegEx by an '<'
2) the use of leading and trailing '.*' seems not needed here.
E.g. in TC folder
- press NumPad "+" key
- enter '<\d' to select every file with at least one digit in it
\d is the regex here
- or enter '<tcm' to select those files
tcm is the regex here
- or '<dll|exe' to select *.DLL and *.Exe files
'dll | exe' is the regex here
Perhaps from more use:
<(32|64).exe
Will select every file like 'xxxx32.exe' and 'xxxx64.exe'
Again, the normally needed '.*' in front is not needed here in TC.
The normal expression outside of TC would be '.+(32|64).exe'
.
2Stefan2
Thank you for clear explanation! And this work fine in
PS I have some experience with RegExp and it is strange to me no luck in this simple case ...
Thank you for clear explanation! And this work fine in
, but for me this didn't work in color filter dialog ..... e.g. or add custom columns dialog of overwrite file dialogE.g. in TC folder
- press NumPad "+" key
PS I have some experience with RegExp and it is strange to me no luck in this simple case ...
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
#259941, TC 11.01 x64, Windows 7 SP1 x64
Correction:Stefan2 wrote:<(32|64).exe
Will select every file like 'xxxx32.exe' and 'xxxx64.exe'
Again, the normally needed '.*' in front is not needed here in TC.
The normal expression outside of TC would be '.+(32|64).exe'
<(32|64).exe
Will select every file like 'xxxx32xexexxxx' and 'xxxx64xexexxxx'
You don't have to specify a pattern for the text before 32 or 64 because that is how regular expression matching works in any program. Regular expression matching tries to match the pattern anywhere in a string.
The expression to match the entire file name would be '^.+(32|64)\.exe$' (the ^ symbol can be left out in this case because it results to the same thing).
Because it does not work in those dialogs. You will have to use the define button there.Ovg wrote:2Stefan2
Thank you for clear explanation! And this work fine in, but for me this didn't work in color filter dialog ..... e.g. or add custom columns dialog of overwrite file dialogE.g. in TC folder
- press NumPad "+" key
The following was added to TC8.50:
The dialog is reused in situations where you cannot use regular expressions directly. So I would call this a bug.HISTORY.TXT wrote:26.02.13 Added: Show example in dialog "expand selection" (key "+" on numeric keypad) how to enter regular expressions directly (32/64)
Right of course. I just don't want to make it too complicated.white wrote:Correction:Stefan2 wrote:<(32|64).exe
Will select every file like 'xxxx32.exe' and 'xxxx64.exe'
Again, the normally needed '.*' in front is not needed here in TC.
The normal expression outside of TC would be '.+(32|64).exe'
<(32|64).exe
Will select every file like 'xxxx32xexexxxx' and 'xxxx64xexexxxx'
Huh?white wrote: You don't have to specify a pattern for the text before 32 or 64 because
that is how regular expression matching works in any program.
Regular expression matching tries to match the pattern anywhere in a string.

Not in every program. It always depends how the regex engine is implemented.
.