function reDirname( platform ) {
	if ( arguments.length > 0 ) {
		if ( !isPlatform( platform ) ) {
			throw new Error( format( 'invalid argument.  Must be one of the following: "%s". Value: `%s`.', PLATFORMS.join( '", "' ), platform ) );
		}
	}
	if ( platform === 'win32' || IS_WINDOWS ) {
		return win32();
	}
	// Case: platform === 'posix'
	return posix();
}
Returns a regular expression to capture a path dirname.

@param {string} [platform] - path platform (`win32` or `posix`)
@throws {Error} platform must be `win32` or `posix`
@returns {RegExp} regular expression

@example
var RE = reDirname();
var dir = RE.exec( '/foo/bar/index.js' )[ 1 ];
// returns <string>