Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
username\s([a-zA-Z0-9]*)(?>\sprivilege\s([0-9]{1,2}))?.*
/
gm
Input 1
1
New
username ytnflvby secret <hash> username eec privilege 15 secret <hash> username protuser privilege 3 password 7 <hash> username wheel privilege 0 secret <hash>
Extraction
username ytnflvby secret <hash> username eec privilege 15 secret <hash> username protuser privilege 3 password 7 <hash> username wheel privilege 0 secret <hash>