Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace syntax has misleading hover text #32

Open
lunalucadou opened this issue Dec 16, 2021 · 6 comments
Open

Replace syntax has misleading hover text #32

lunalucadou opened this issue Dec 16, 2021 · 6 comments

Comments

@lunalucadou
Copy link

image

The hover text makes it look like you do %1, %2, etc to insert captured groups, but it's actually \1, \2, etc because it's using Python regex.

This had me really confused until I looked at the source code and realized why %1 was treated as a literal rather than inserting a captured group, and I believe it should be changed to reflect its actual usage.

If "enumerate" means anything other than "insert capture groups," I think there should be more information on what it does, and I think there should also be a note somewhere (in both the application and repo readme, preferably) that it uses Python regex so nobody else will get confused like I was.

@xenopeek
Copy link

Enumerate does not refer to regular expression back reference. The verb enumerate means to count and name each item in a list. E.g., %n replaces with 1, 2, 3, …; %00n replaces with 001, 002, 003, …. and so on.

I think when the Regular expression option is ticked in the dialog, the hint text should change to mention back references.

@lunalucadou
Copy link
Author

image

How exactly is enumerate supposed to work?

Also, when regular expression box is ticked, the hint text does not change for me.

@xenopeek
Copy link

xenopeek commented Dec 17, 2021

That is strange and may be a separate bug, this strange behavior when the find field is left empty.

You'd normally enter what you want to find and what you want to replace it with. And instead of static text you can replace it with an automatic increasing number, an enumeration. Like this:
image

In the screenshot I have a set of files all with a name "somename something .txt" and I instruct Bulky to find the "name something " part and replace it with a 3 digit enumeration. The * in name* is a wildcard meaning zero or more characters (and as Bulky is set to replace name only the wildcard doesn't match the file extension).

And you can mix this with static text. For example if you want to rename all the "somename something .txt" files to "newname 3 digits.txt" like this:
image

@lunalucadou
Copy link
Author

That's pretty useful. I wish there was a help file or wiki page that described this stuff.

I think when the Regular expression option is ticked in the dialog, the hint text should change to mention back references.

Does not work for me.

@xenopeek
Copy link

xenopeek commented Dec 19, 2021

Does not work for me.

I meant: I think this is an oversight and that this isn't programmed yet. That the hint text is static and it isn't programmed yet to change it based on context.

@lunalucadou
Copy link
Author

Oh, my mistake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants