in reply to regex matches with () in strings

Just for completeness:
$srcroot=quotemeta("/some/(dir)");
is functionally equivalent to the above proposed solutions, albeit more verbose and (possibly) easier to understand for those less familiar with regexes.