In Java, how can you determine if a String matches a format string (ie: song%03d.mp3)?
song%03d.mp3
In other words, how would you implement the following function?
the string class has the matches method, you can pass a regex there. String.matches(String)
for the regex you can see this: http://download.oracle.com/javase/1,5.0/docs/api/java/util/regex/Pattern.html examples:
"song001.mp3".matches("song\\d{3}\\.mp3");