I am trying unsuccessfully to use
Java to match a line so I can use particular parts of the line. The
String line is:
String line = "-rw-rw-r-- 1 sherman sherman 0 Feb 14 12:17 nonpedalSwing";
I am using
Pattern and Matcher. This is an example of how I want to seperate the line so I can use sub 2, sub 3, and sub 5.
String Pattern = "^(-rw-rw-r-- 1 sherman sherman 0)(Feb)(14)( 12:17 )(nonpedalSwing)";
This does not work for me:
String Pattern = "^(-\\w+-\\w+-\\w--\\s\\d\\s\\w+\\s\\w+\\s+\\d\\s)(\\w+)(\\s)(\\d+)(\ \s\\d+:\\d+\\s)(\\w+)";
At the end of this message is the code I am playing with.
How would you do it?
Thanks; Sherman