Is there a shell equivalent of PHP's preg_match?
I'm trying to extract the database name from this string in a shell script.
define('DB_NAME', 'somedb');
Using preg_match in PHP I could just do something like this.
preg_match('define(\'DB_NAME\','(.*)'\'\)',$matches);
echo $matches[1];
How can I accomplish the same thing in a shell script?