ayoisaiah / f2

F2 is a cross-platform command-line tool for batch renaming files and directories quickly and safely. Written in Go!
MIT License
856 stars 37 forks source link

Not working with basic regex? #50

Closed MaikoID closed 1 year ago

MaikoID commented 1 year ago

I had high hopes for this tool but unless I am entirely misreading stuff basic regex does not work..

maikocosta@Maikos-Mac fromOO % f2 --version F2 version v1.9.1 https://github.com/ayoisaiah/f2/releases/v1.9.1

one of the many files that f2 does nothing recognizable

maikocosta@Maikos-Mac fromOO % file Umwelt/Done/87_Internet\ Telenor\ \#w38

Umwelt/Done/87_Internet Telenor #w38: directory
maikocosta@Maikos-Mac fromOO % f2 -f 'Internet' -R

*————————————————————————————————*————————————————————————————————*————————*
|            ORIGINAL            |            RENAMED             | STATUS |
*————————————————————————————————*————————————————————————————————*————————*
| Umwelt/Done/87_Internet        | Umwelt/Done/87_Internet        | ok     |
| Telenor #w38/Internet Telenor  | Telenor #w38/Telenor #w38.md   |        |
| #w38.md                        |                                |        |
*————————————————————————————————*————————————————————————————————*————————*

 DRY RUN  Commit the above changes with the -x/--exec flag

maikocosta@Maikos-Mac fromOO % f2 -f '87_Internet' -R
 INFO  Failed to match any files

maikocosta@Maikos-Mac fromOO % f2 -f '_Internet' -R 
 INFO  Failed to match any files

maikocosta@Maikos-Mac fromOO % f2 -f '87_' -R      
 INFO  Failed to match any files
maikocosta@Maikos-Mac fromOO % f2 -f '\/[0-9]+_' -R
 INFO  Failed to match any files

Am I missing something here?

ayoisaiah commented 1 year ago

@MaikoID I could not reproduce your issues, except for the last one, but the regex was wrong for matching87_ in that case:

image

Could you please share some more details about your environment? I can see you're on a Mac. What shell are you using?

ayoisaiah commented 1 year ago

I'm closing this as I haven't heard back from you in a while.