RegEx for parsing FTP LIST command

Need to parse the FTP LIST command output? I did. Here’s what I came up with, its based on another post that didn’t quite work for me. The code below works specifically on the FilZilla FTP Server which I was targetting.


^(?<dir>[-ld])(?<permission>([-r][-w][-xs]){3})s+(?<filecode>d+)s+(?<owner>w+)s+(?<group>w+)s+(?<size>d+)s+(?<timestamp>((?<month>w{3})s+(?<day>d{2})s+(?<hour>d{1,2}):(?<minute>d{2}))|((?<month>w{3})s+(?<day>d{2})s+(?<year>d{4})))s+(?<name>.+)$

  • Pe

    Thanks, I need that for FZServer too.
    I’ll try it, but I think ymmd!