[Beta] Bug in MRT using RegExp is still present
Moderators: white, Hacker, petermad, Stefan2
- XPEHOPE3KA
- Power Member
- Posts: 854
- Joined: 2006-03-03, 18:23 UTC
- Location: Saint-Petersburg, Russia
[Beta] Bug in MRT using RegExp is still present
I needed to rename such files as
1_bla.txt
13_blabla.txt
423_blablabla.txt
and so on (less than four digits, numbers are NOT suitable for [C]!!!)
I decided to do it like this (regexp enabled):
Search for: ^(\d\d)_(.*)|^(\d)_(.*)
Replace with: 0$1_$2|00$3_$4
But that doesn't work properly - the | symbol is inserted in the resulting filename, while it normally is for splitting "search for"s and "replace with"s from each other.
I know I can perform the desired renaming in two steps, but why can't I use the | symbol?
1_bla.txt
13_blabla.txt
423_blablabla.txt
and so on (less than four digits, numbers are NOT suitable for [C]!!!)
I decided to do it like this (regexp enabled):
Search for: ^(\d\d)_(.*)|^(\d)_(.*)
Replace with: 0$1_$2|00$3_$4
But that doesn't work properly - the | symbol is inserted in the resulting filename, while it normally is for splitting "search for"s and "replace with"s from each other.
I know I can perform the desired renaming in two steps, but why can't I use the | symbol?
Last edited by XPEHOPE3KA on 2006-06-22, 19:40 UTC, edited 1 time in total.
- XPEHOPE3KA
- Power Member
- Posts: 854
- Joined: 2006-03-03, 18:23 UTC
- Location: Saint-Petersburg, Russia
- XPEHOPE3KA
- Power Member
- Posts: 854
- Joined: 2006-03-03, 18:23 UTC
- Location: Saint-Petersburg, Russia
But why?
You know, if I have a file "aaabbb.txt", and "search for"=aaa|bbb, and "replace with"=ccc|ddd than I will get cccddd.txt. So I want this with regexps too.
Maybe, regexps have some syntax which doesn't allow |?
You know, if I have a file "aaabbb.txt", and "search for"=aaa|bbb, and "replace with"=ccc|ddd than I will get cccddd.txt. So I want this with regexps too.
Maybe, regexps have some syntax which doesn't allow |?
F6, Enter, Tab, F6, Enter, Tab, F6, Enter, Tab... - I like to move IT, move IT!..
- majkinetor !
- Power Member
- Posts: 1580
- Joined: 2006-01-18, 07:56 UTC
- Contact:
- SanskritFritz
- Power Member
- Posts: 3693
- Joined: 2003-07-24, 09:25 UTC
- Location: Budapest, Hungary
You cannot mix regexp and TC specific search attributes. They are two different engines. The regular expression syntax does not allow pipes in a replacemet expression. AFAIK.You know, if I have a file "aaabbb.txt", and "search for"=aaa|bbb, and "replace with"=ccc|ddd than I will get cccddd.txt. So I want this with regexps too.
I switched to Linux, bye and thanks for all the fish!
- XPEHOPE3KA
- Power Member
- Posts: 854
- Joined: 2006-03-03, 18:23 UTC
- Location: Saint-Petersburg, Russia
It doesn't, but Ghisler should take care of that. Now TC parses those two strings without any notice to TC's | when regexp is enabled.
| in regexps stands for "or" in such expression (bla|anotherbla|somethingelse), so it may be a little hard to distinguish where | belongs to regexp and where to TC internal syntax. To avoid this, I guess, the symbol | should be changed to something else in internal syntax.
| in regexps stands for "or" in such expression (bla|anotherbla|somethingelse), so it may be a little hard to distinguish where | belongs to regexp and where to TC internal syntax. To avoid this, I guess, the symbol | should be changed to something else in internal syntax.
F6, Enter, Tab, F6, Enter, Tab, F6, Enter, Tab... - I like to move IT, move IT!..
- majkinetor !
- Power Member
- Posts: 1580
- Joined: 2006-01-18, 07:56 UTC
- Contact:
- XPEHOPE3KA
- Power Member
- Posts: 854
- Joined: 2006-03-03, 18:23 UTC
- Location: Saint-Petersburg, Russia
Just to keep the topic topmost until Mr. Ghisler comes, maybe let's discuss a possible replacement of |?
BTW, the | can be left as it is, if regexp switch is off, so most users (2m care for newbies) won't notice any difference.
AFAIC, ! can be used, as it's not used in regexps. Double ! will stand for '!'. What do you think?
BTW, the | can be left as it is, if regexp switch is off, so most users (2m care for newbies) won't notice any difference.
AFAIC, ! can be used, as it's not used in regexps. Double ! will stand for '!'. What do you think?
F6, Enter, Tab, F6, Enter, Tab, F6, Enter, Tab... - I like to move IT, move IT!..
- XPEHOPE3KA
- Power Member
- Posts: 854
- Joined: 2006-03-03, 18:23 UTC
- Location: Saint-Petersburg, Russia
I support the request: replacing of multiple strings should work with regular expressions too. If there are doubts that the users mey become confused, this behaviour may be controlled by an additional wincmd.ini option.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
Using TC 10.52 / Win10 x64
Using TC 10.52 / Win10 x64
- XPEHOPE3KA
- Power Member
- Posts: 854
- Joined: 2006-03-03, 18:23 UTC
- Location: Saint-Petersburg, Russia
- ghisler(Author)
- Site Admin
- Posts: 48093
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
You cannot use the | for multiple strings together with regular expressions. This is not supported, and it's currently not planned either, sorry.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- XPEHOPE3KA
- Power Member
- Posts: 854
- Joined: 2006-03-03, 18:23 UTC
- Location: Saint-Petersburg, Russia
Why not? It's fixable easily - see the upper postings:
http://ghisler.ch/board/viewtopic.php?p=87655#87655
and the next.
http://ghisler.ch/board/viewtopic.php?p=87655#87655
and the next.
F6, Enter, Tab, F6, Enter, Tab, F6, Enter, Tab... - I like to move IT, move IT!..