Regex: parsing a linux ftp list string. result is a list of several groups like :
dir (-,l,d)
p...
Posted by: RegexLib.com - Recent Patterns,
on 26 Jul 2005 |
View original | Bookmarked: 0 time(s)
Regex:
parsing a linux ftp list string. result is a list of several groups like :
dir (-,l,d)
permission (lrwxrwxrwx)
filecode (any number)
owner (what it says - number or text)
group (same as owner)
timestamp (what it says, including groups like day, month, hour, minute)
name (the file, directory or linkname)
*********************************************
^((<dir>[\-ld])(<permission>([\-r][\-w][\-xs]){3})\s+(<filecode>\d+)\s+(<owner>\w+)\s+(<group>\w+)\s+(<size>\d+)\s+(<timestamp>(<year>\d{4})-(<month>\d{2})-(<day>\d\d)\s+(<hour>\d{2}):(<minute>\d{2}))\s+(<name>\w.+))$