• Post Reply Bookmark Topic Watch Topic
  • New Topic

FilePattern  RSS feed

 
mark smith
Ranch Hand
Posts: 258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

with a file pattern, i try to find some file...

example: TRX-SOUS-SYST20100927211610.TXT




when i debug, i see name = "TRX-SOUS-SYST20100927211610.TXT"
so i don't understand, why this pattern don't work: "TRX-SOUS-SYST.*20100927*.TXT"

any idea?


edit:

String pre = "TRX-SOUS-SYST.*";
String userInput = "20100927";
String post="*.TXT";

become

String pre = "TRX-SOUS-SYST";
String userInput = "20100927";
String post=".*TXT";

and that work fine
 
Jelle Klap
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, the name is not an exact match against the regex pattern, which I guess you've already figured out.
To understand why, have a look at the documentation of java.util.regex.Pattern, specifically the meaning and use of the . and * special characters.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!