Author Topic: Non-greedy dot is not supported  (Read 11193 times)

Suncatcher

  • Active Member
  • ***
  • Posts: 104
    • View Profile
Non-greedy dot is not supported
« on: September 14, 2023, 09:06:44 »
Why non-greedy dot is not supported in Multi commander?
The regex
Code: [Select]
\s\(ASOT.*?\)| throws this error.

In this thread you say that MC has ECMA-complient Regex engine, and ECMA supports .? pattern perfectly. Why MC not?

UPDATE: even this pattern without non-greediness throws error
Code: [Select]
\s\(ASOT.*\)|
and this too
Code: [Select]
\s\(ASOT[^)]*\)|
The most odd thing that it is showing correct transformation in live preview but the error is thrown when I press Start to start the renaming
« Last Edit: September 14, 2023, 09:24:04 by Suncatcher »

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4450
    • View Profile
    • Multi Commander
Re: Non-greedy dot is not supported
« Reply #1 on: September 14, 2023, 09:31:46 »
MC do not have its own regex engine. it is using the reqex engine that is included in C++. the option for the regex engine is set to be ECMA, but I don't know if they are any exception or if you need to write in other way.  What it support and not, I don't know. I got it to work with most pattern I tried but Im no regex expert. I don't understand what your are trying to so with the regex
« Last Edit: September 14, 2023, 09:49:21 by Mathias (Author) »