You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "vva (JIRA)" <ji...@apache.org> on 2010/07/26 11:19:51 UTC
[jira] Created: (IO-246) FilenameUtils.wildcardMatch gives
incorrect results
FilenameUtils.wildcardMatch gives incorrect results
---------------------------------------------------
Key: IO-246
URL: https://issues.apache.org/jira/browse/IO-246
Project: Commons IO
Issue Type: Bug
Components: Filters
Affects Versions: 1.4
Environment: any
Reporter: vva
Priority: Minor
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.
[jira] Resolved: (IO-246) FilenameUtils.wildcardMatch gives
incorrect results
Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IO-246?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Niall Pemberton resolved IO-246.
--------------------------------
Assignee: Niall Pemberton
Fix Version/s: 2.0
Resolution: Fixed
Fixed, http://svn.apache.org/viewvc?view=revision&revision=1002582
> FilenameUtils.wildcardMatch gives incorrect results
> ---------------------------------------------------
>
> Key: IO-246
> URL: https://issues.apache.org/jira/browse/IO-246
> Project: Commons IO
> Issue Type: Bug
> Components: Filters
> Affects Versions: 1.4
> Environment: any
> Reporter: vva
> Assignee: Niall Pemberton
> Priority: Minor
> Fix For: 2.0
>
> 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.
[jira] Issue Comment Edited: (IO-246) FilenameUtils.wildcardMatch
gives incorrect results
Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IO-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12915781#action_12915781 ]
Niall Pemberton edited comment on IO-246 at 9/28/10 11:17 AM:
--------------------------------------------------------------
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 {code}"?*"{code} 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 {code}"aa?*"{code} always means "any character in the third position" for the "?" wildcard.
was (Author: niallp):
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: https://issues.apache.org/jira/browse/IO-246
> 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.
[jira] Updated: (IO-246) FilenameUtils.wildcardMatch gives
incorrect results
Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IO-246?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
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: https://issues.apache.org/jira/browse/IO-246
> 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.