regex to get db username from config.php

Mouth

Well-known member
Hi,
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
PHP:
[...]
$config['db']['username'] = 'myusername';
[...]

my best effort, yet still unsuccessful, grep so far is
Code:
grep -o "(\$config\[\'db\'\]\[\'username\'\]\ \=\ \').*" library/config.php

Can anyone assist with the correct regex for the grep to pull out myusername please?
 
Top Bottom