[Using 21.80.0200]
Came across this unexpected behavior which I don't think is right, unless I am misunderstanding something.
1. Run xyplorer /fresh
2. Create file named "Aaa Iii Xxx"
3. Use Search and Replace to rename Ii/II. It works and you now have "AAa IIi Xxx".
4. Repeat step 3, and nothing changes. Why doesn't it change the remaining Ii to II ?
Same thing happens if you try search and replace Aa/AA or Xx/XX.
Search and Replace: Ii/II doesn't work for IIi
Search and Replace: Ii/II doesn't work for IIi
Running on Windows 10 Pro 64-bit quad-core ASUS G752-VY notebook with 64 GB RAM, over 26 external USB3 drives attached via multiple powered hubs with letters and mount points, totaling 120+ TB.
Re: Search and Replace: Ii/II doesn't work for IIi
At least I can confirm it. Don will (probably) fix it when he has time...
One of my scripts helped you out? Please donate via Paypal
-
- Site Admin
- Posts: 60567
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Search and Replace: Ii/II doesn't work for IIi
Use switch
/c
to make the comparison case sensitive: Ii/II /c
FAQ | XY News RSS | XY Twitter
Re: Search and Replace: Ii/II doesn't work for IIi
Ok, that works for dealing with the second case. I assume you regard the inconsistency as undesirable.
Running on Windows 10 Pro 64-bit quad-core ASUS G752-VY notebook with 64 GB RAM, over 26 external USB3 drives attached via multiple powered hubs with letters and mount points, totaling 120+ TB.
-
- Site Admin
- Posts: 60567
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Search and Replace: Ii/II doesn't work for IIi
Certainly an interesting case. This will handle it in the next beta:
Code: Select all
* File | Rename Special | Search and Replace...: If the replacement just
changes the CASE of the replaced string (eg: re/Re) then the matching is
now case-sensitive by default. You don't have to pass the /c switch for
case-sensitive matching.
FAQ | XY News RSS | XY Twitter
-
- Site Admin
- Posts: 60567
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Search and Replace: Ii/II doesn't work for IIi
Well, I shot too fast. That "fix" would break old code and would also limit the functionality of Search and Replace.
What we have here might be undesirable but it's not an inconsistency but a logical outcome of case-insensitive matching and the standard replacement rules (which are not recursive = do not replace again what has been replaced). ATM I see no way to improve the situation. The
What we have here might be undesirable but it's not an inconsistency but a logical outcome of case-insensitive matching and the standard replacement rules (which are not recursive = do not replace again what has been replaced). ATM I see no way to improve the situation. The
/c
switch is the way to go for you.FAQ | XY News RSS | XY Twitter
Re: Search and Replace: Ii/II doesn't work for IIi
I understand the issue of recursive replacement; I would not expect the second replacement to take place while doing the first one. But in this example, there are 2 separately initiated, independent search/replace actions, each for a single replacement. The fact that the second replacement fails is clearly inconsistent. It makes one think that there is something special about doing the replacement when the pattern is followed by a space, but that surely shouldn't be the case.admin wrote: ↑02 Jun 2021 08:08 What we have here might be undesirable but it's not an inconsistency but a logical outcome of case-insensitive matching and the standard replacement rules (which are not recursive = do not replace again what has been replaced). ATM I see no way to improve the situation. The/c
switch is the way to go for you.
Running on Windows 10 Pro 64-bit quad-core ASUS G752-VY notebook with 64 GB RAM, over 26 external USB3 drives attached via multiple powered hubs with letters and mount points, totaling 120+ TB.
-
- Site Admin
- Posts: 60567
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Search and Replace: Ii/II doesn't work for IIi
Nope, it has nothing to do with the space. Since your replace operation is case-insensitive in both cases the red pair of "ii" is replaced by "II". In the second run you don't note it because it is already "II":
"AAa IIi Xxx"
"AAa IIi Xxx"
FAQ | XY News RSS | XY Twitter
Re: Search and Replace: Ii/II doesn't work for IIi
So you are saying that since case sensitivity is off, the second independent search/replace action is matching and replacing "II" and not the remaining "Ii" so that in effect, there is no apparent change. Is that right?
Running on Windows 10 Pro 64-bit quad-core ASUS G752-VY notebook with 64 GB RAM, over 26 external USB3 drives attached via multiple powered hubs with letters and mount points, totaling 120+ TB.