Regular Expresion Search not working at end of string
Moderators: Hacker, Stefan2, white
Regular Expresion Search not working at end of string
Want to delete all DE-de*.* files/folder, except DE-def*.* or DE-dea*, ie: "DE-define", "DE-de", "DE-de dict", "DE-dea" should return: "DE-de", "DE-de dict"
My regular expresion search is: DE-de[^af] which works in textpad, even if "DE-De" is alone in a line, but doesn't work on TotalCommander:
"DE-de" is NOT matched. I do have lot of similar searches with same problem...
Is there a workaround to make that search?
My regular expresion search is: DE-de[^af] which works in textpad, even if "DE-De" is alone in a line, but doesn't work on TotalCommander:
"DE-de" is NOT matched. I do have lot of similar searches with same problem...
Is there a workaround to make that search?
- petermad
- Power Member
- Posts: 12465
- Joined: 2003-02-05, 20:24 UTC
- Location: Valsted, Denmark
- Contact:
Re: Regular Expresion Search not working at end of string
Have you tried: DE-de($|[^af])
Last edited by petermad on 2023-03-04, 02:13 UTC, edited 1 time in total.
License #524 (1994)
Danish Total Commander Translator
TC 10.52 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.4.1.1022 (x64)
TC 3.42b3 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 10.52 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.4.1.1022 (x64)
TC 3.42b3 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: Regular Expresion Search not working at end of string
Can't tell why the negated class doesn't find/match the line end, but
works for your example.
Regards
Dalai
Code: Select all
de-de($|[^af])
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo - Download-Mirror
Re: Regular Expresion Search not working at end of string
No, it doesn't. Try "DE-De" on the last line of a file.
You can use the expression given by the other users, or following your line of thinking, you can do a Negative Lookahead search:
Code: Select all
DE-de(?![af])
[ ] denotes a Character class. So it matches a character, which can also be a newline character. There is no newline character in filenames.
In contrast, $ denotes a line or string boundary.
Re: Regular Expresion Search not working at end of string
Moderator message from: white » 2023-03-04, 15:05 UTC
Moved from Bugs forum to English forum.
Re: Regular Expresion Search not working at end of string
actually I'm trying to find all regional non english files, adding some exceptions of non regional files; my full expression gives error "lookaround brackets must be at the very begining/ending":
Something simpler also gives the error:
This succeeds:
In textpad all works with no errors, any idea of why it doesn't work here?
Code: Select all
ar_ae|ar_sa(?![b])|az_az|ba_ba|be_by|bg_bg|bn_bd|ca_ca|(ca|eu|gl|va)_es|cn_sc|cn_tc|cs_cz|cz_cz|da_dk|de_(ch|de)(?![af])|el_gr(?![o])|en_(ae|au|ca|gb|il|xc|xm)|es_as|et_ee|fa_ir|fi_fi|fil_ph|fr_(be|br|ca|fr|ma|mx|xm)|gd_gb|he_il|hi_in|hr_hr|hu_hu|hy_am|id_id|in_in(?![fli])|is_is(?![a])|it_it|ja_jp|jp_jp|ka_ge|kk_kz|ko_kr|lt_lt|lv_lv|mk_mk|mk_yu|mn_mn|mt_mt|(nb|nn|no)_no|nl_nl|pa_in|pl_pl(?![a])|pt_br|pt_pt|ro_ro|ru_ru|sh_yu|sk_sk|sl_si|slo_slo|sq_al|sr_(cs|cir|sp|yu)|sv_(fi|se|sv)|th_th(?![e])|tl_ph|tr_tr|ua_ua|ug_cn|uk_ua|vi_vn|zh_chs|zh_(cht|cn|hk|mo|sg|tw)
Code: Select all
ar_ae|ar_sa(?![b])|az_az
Code: Select all
ar_ae|ar_sa(?![b])
Re: Regular Expresion Search not working at end of string
https://regex.sorokin.engineer/en/latest/regular_expressions.html?highlight=lookbehind#assertions
"...... Brackets for lookahead must be at the very ending of expression, and brackets for lookbehind must be at the very beginning. So assertions between choices |, or inside groups, are not supported. ....."
Try to use Everything (www.voidtools.com) with TC
"...... Brackets for lookahead must be at the very ending of expression, and brackets for lookbehind must be at the very beginning. So assertions between choices |, or inside groups, are not supported. ....."
Try to use Everything (www.voidtools.com) with TC
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 10.52 x64, Windows 7 SP1 x64
#259941, TC 10.52 x64, Windows 7 SP1 x64
Re: Regular Expresion Search not working at end of string
"Everything" program would be better if it could manage to use internal windows Search database instead of adding another service and database for same task. Anyways, I hate things running in background so "Everything" is not an option. I even have Search service disabled among hundreds of other things (check my optimwin-batch in sourceForge which I will update soon).
Working solution is using first suggested solution ($|[^xyz]):
Code: Select all
ar_ae|ar_sa|az_az|ba_ba|be_by|bg_bg|bn_bd|ca_ca|(ca|eu|gl|va)_es|cn_sc|cn_tc|cs_cz|cz_cz|da_dk|de_(ch|de)($|[^af])|el_gr($|[^o])|en_(ae|au|ca|gb|il|xc|xm)|es_as|et_ee|fa_ir|fi_fi|fil_ph|fr_(be|br|ca|fr|ma|mx|xm)|gd_gb|he_il|hi_in|hr_hr|hu_hu|hy_am|id_id|in_in($|[^fli])|is_is($|[^a])|it_it|ja_jp|jp_jp|ka_ge|kk_kz|ko_kr|lt_lt|lv_lv|mk_mk|mk_yu|mn_mn|mt_mt|(nb|nn|no)_no|nl_nl|pa_in|pl_pl($|[^a])|pt_br|pt_pt|ro_ro|ru_ru|sh_yu|sk_sk|sl_si|slo_slo|sq_al|sr_(cs|cir|sp|yu)|sv_(fi|se|sv)|th_th($|[^e])|tl_ph|tr_tr|ua_ua|ug_cn|uk_ua|vi_vn|zh_chs|zh_(cht|cn|hk|mo|sg|tw)
Code: Select all
ar-ae|ar-sa|az-az|ba-ba|be-by|bg-bg|bn-bd|ca-ca|(ca|eu|gl|va)-es|cn-sc|cn-tc|cs-cz|cz-cz|da-dk|de-(ch|de)($|[^af])|el-gr($|[^o])|en-(ae|au|ca|gb|il|xc|xm)|es-as|et-ee|fa-ir|fi-fi|fil-ph|fr-(be|br|ca|fr|ma|mx|xm)|gd-gb|he-il|hi-in|hr-hr|hu-hu|hy-am|id-id|in-in($|[^fli])|is-is($|[^a])|it-it|ja-jp|jp-jp|ka-ge|kk-kz|ko-kr|lt-lt|lv-lv|mk-mk|mk-yu|mn-mn|mt-mt|(nb|nn|no)-no|nl-nl|pa-in|pl-pl($|[^a])|pt-br|pt-pt|ro-ro|ru-ru|sh-yu|sk-sk|sl-si|slo-slo|sq-al|sr-(cs|cir|sp|yu)|sv-(fi|se|sv)|th-th($|[^e])|tl-ph|tr-tr|ua-ua|ug-cn|uk-ua|vi-vn|zh-chs|zh-(cht|cn|hk|mo|sg|tw)
Re: Regular Expresion Search not working at end of string
Everything 1.5 working with Windows Search just fine ....
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 10.52 x64, Windows 7 SP1 x64
#259941, TC 10.52 x64, Windows 7 SP1 x64
Re: Regular Expresion Search not working at end of string
I didn't said it doesn't, what I meant is I don't like having two programs running to do the same task. Everything would be better if instead of having it's own Database and Service, would use the already running windows Search Service and database and save resources. In some limited machines I even disable Windows Search Service to gain some speed.
Re: Regular Expresion Search not working at end of string
In my opinion, the Everything Service does not need to be mentioned in this context,
because it only needs between 1.2 and 1.4 MB RAM.
You can also keep the database (Everything.db) small if you do not use the options "Properties" and "Content"
in Everything 1.5a and instead define these settings in Windows Search.
Access to the Windows search in Everything is possible with the parameter: si:
and in Total Commander with the parameter: ev:si:.
See also:
- Content & Properties in Everything 1.5a - My Settings - Example
- 14. Windows Search in Total Commander and 'Everything'
Re: Regular Expresion Search not working at end of string
Problem is not only RAM (and I seriously doubt so little usage with >300k files in a small win10 (only one monthly update will leave >100k useless files&folders in Windows\Servicing\LCU folder). But also the overhead on file operations due to multiple index updates. On old mechanic HDs this will result in slower operation. My approach is to avoid unnecessary background programs, ideally none. XP was a lot better in that aspect, since win7 MS started bloated taskscheduler with >100 useless tasks, etc.