Regular Expressions 101

Community Patterns

Community Library Entry

3

Regular Expression
PCRE (PHP <7.3)

/
(?<type>.{1})(?<user_access>.{3})(?<group_access>.{3})(?<other_access>.{3}) +(?<oder>[0-9]*) +(?<owner>[a-z]*) +(?<group>[a-z]*) +(?<size>\d*) +(?<month>[a-z]{3}) +(?<day>\d{1,2}) +(?<year>\d{0,4})(?<time>(?<hour>\d{2}):(?<minute>\d{2}))? +(?<filename>(?<basename>.+)\.(?<extension>.*)|(?<no_extension_filename>.*))
/
gmi

Description

parse linux ln -l output command

Submitted by guignol95 - 9 years ago