Regular Expressions 101

Community Patterns

ls -a Linux Output - Parse Filename

1

Regular Expression
PCRE (PHP <7.3)

/
\S+\s+\S+\s+\S+\s+\S+\s+\S+\s+\S+\s+\S+\s+\S+\s+(.*)
/
g

Description

Parse just the filename from ls -a output on Linux.

Submitted by Brian Hannan - 8 years ago