Add support for 'random' pattern.