Memoizes the createRegexFromDoubleArray with the twoPartTransitionWords.

@param {Array} twoPartTransitionWords The array containing two-part transition words.

@returns {RegExp} The RegExp to match text with a double array.
function getRegexFromDoubleArray( twoPartTransitionWords ) {
	const cacheKey = flattenDeep( twoPartTransitionWords ).join( "" );
	if ( regexFromDoubleArrayCacheKey !== cacheKey || regexFromDoubleArray === null ) {
		regexFromDoubleArrayCacheKey = cacheKey;
		regexFromDoubleArray = createRegexFromDoubleArray( twoPartTransitionWords );
	}
	return regexFromDoubleArray;
}