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.+))$

Advertisement
Category: Regex | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 2029 | Hits: 26

Similar Posts

  • List<T>.ConvertAll<>() more
  • A casing technique in Visual Basic coding more
  • Refactoring: Using object constructors in HQL with NHibernate more
  • LINQ Tip of the week: System.String support more
  • HttpHandler To Assist In Preventing Image Leeching more
  • String manipulation tricks more
  • Very Simple .NET Thumbnail Creation Code more
  • Using Enums in List Controls more
  • Using Enums in List Controls more
  • ORM Release History : Q1 2009 SP1 (version 2009.1.405.1) more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD