commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton (JIRA)" <>
Subject [jira] Updated: (IO-246) FilenameUtils.wildcardMatch gives incorrect results
Date Tue, 28 Sep 2010 15:16:35 GMT


Niall Pemberton updated IO-246:

    Attachment: IO-246-wildcardMatch.patch

While you're probably right that using "*?" in a wildcard expression should work as you expect
- it would be difficult to fix wildcardMatch() to cater for this.

Using "?*" effectively means the same thing - unfortunately this does not work either - but
its much easier to fix. Also in my mind its more precise. For example an expression like "aa?*"
always means "any character in the third position" for the "?" wildcard.

> FilenameUtils.wildcardMatch gives incorrect results
> ---------------------------------------------------
>                 Key: IO-246
>                 URL:
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Filters
>    Affects Versions: 1.4
>         Environment: any
>            Reporter: vva
>            Priority: Minor
>         Attachments: IO-246-wildcardMatch.patch
> This wildcard pattern "*?" does not match correctly. The command:
> System.out.println(FilenameUtils.wildcardMatch("aaa", "*?"));
> prints out "false", even though it matches. The wildcard mask is a bit unusal, but not
incorrect. It should match any input with at least one character.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message