Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Community Library
How to contribute
x
GECOS and /etc/passwd
Open Workspace
PCRE2 (PHP)
Match
Created 2023-04-13 23:10
0
Regular Expression
/
^
(?'username'
.
*
)
:
.
*
:
(?'UID'
.
*
)
:
(?'GID'
.
*
)
:
(?'GECOS'
.
*
)
:
(?'home'
.
*
)
:
(?'shell'
.
*
)
$
/
gm
Description
Pull out fields in /etc/password and group.
Submitted by
Anonymous