Peter De Maeyer created IO-886:
----------------------------------

             Summary: PathUtils.RelativeSortedPaths.extractKey uses incorrect 
regular expression
                 Key: IO-886
                 URL: https://issues.apache.org/jira/browse/IO-886
             Project: Commons IO
          Issue Type: Bug
          Components: Utilities
    Affects Versions: 2.21.0
            Reporter: Peter De Maeyer
         Attachments: image-2026-02-07-14-27-32-345.png

{{PathUtils.RelativeSortedPaths.extractKey}} uses a regular expression with an 
escape character to escape a single character separator, but separator is a 
string so in theory can be multiple characters. IntelliJ gives an error on this 
(the compiler doesn't).

!image-2026-02-07-14-27-32-345.png!

In practice, all file systems have single-character separators AFAIK, so it's 
more a theoretical issue.

I suggest to just remove the regular expression, there is no need for it. Just 
use an exact string-matching replacement instead.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to