• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

regex to get db username from config.php


Well-known member
I'm only a basic regex'er, so looking for some help please. Wanting to grep the xf config.php to pull out the db username.

config.php contains
$config['db']['username'] = 'myusername';
my best effort, yet still unsuccessful, grep so far is
grep -o "(\$config\[\'db\'\]\[\'username\'\]\ \=\ \').*" library/config.php
Can anyone assist with the correct regex for the grep to pull out myusername please?