Repository navigation
Conversation
mathiasrw
marked this pull request as draft
October 25, 2026 22:24
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #856
Stacked on #855.
Change
rris the object behind the short names.rr.yearis$year,rr[1]is$1, andrr.nis$n, with all the cousins, likerr.n00andrr.year_. Groups are text and the numbers are numbers. A named group overwrites a name it shares, also_.rr._has the values of RexReplace with long names:rr._.fileInfo:filePath,filePathRel,dirPath,dirPathRel,dirName,fileName,name,ext,bytes,size,mtime,ctime,mtimeObj,ctimeObjrr._.count:fileNumber($n),filesTotal($t),matchedFileNumber($i),changedFileNumber($c),matchThisFile($m),matchUntilNow($M)text,find,pipe,cwd,time,timeObjrr.stdinis the piped data, andrr.print()andrr.printErr()print to stdout and stderr with a line break, also with--quiet-total.pad(value, width = 3, char = '0'), likepad($1)for007.file_pathandfile_path_rel, the same asfileandfile_rel, with their space cousins.rrruns once per match, as it can reach a group in a way the search of the code can not see. It is found asrr.orrr[with no letter, digit,_or$in front.The
rrobject is only made when the code uses it. The values of the file are made once per file, and each match gets an object on top with$m,$M, the groups and the counts. 20 000 matches:$1.toUpperCase()takes 230 ms, as before, andrr[1].toUpperCase()287 ms.Tests
test/fix/856.test.jsis new, and 19 of its 20 tests fail without the change. The one that passes checks thatbrr.nis not taken forrr.n. It covers each short name inrr, text and numbers, the run per match, a group that overwritesrr.nandrr._, the long names of a file and of the counts over three files,rr.printwith--quiet-total,rr.printErr,rr.stdin,pad(),file_path, and that a file without a match does not run the code. The help and the README tell all of it.yarn test-cipasses.Follow-up
For #855: shorter help for
-Eand--flags, and the comments that said what the code does are gone or say why now.