// Initialise jQuery Regex...
jQuery.expr[':'].regex = function(elem, index, match) {
    var matchParams = match[3].split(','),
        validLabels = /^(data|css):/,
        attr = {
            method: matchParams[0].match(validLabels) ?
                        matchParams[0].split(':')[0] : 'attr',
            property: matchParams.shift().replace(validLabels,'')
        },
        regexFlags = 'ig',
        regex = new RegExp(matchParams.join('').replace(/^\s+|\s+$/g,''), regexFlags);
    return regex.test(jQuery(elem)[attr.method](attr.property));
}

// ...and use it to overcome the 'double margin' bug. Add display:inline to all floated elements
function double_margin() {
	jQuery(':regex(css:float, left|right)').css('display', 'inline');
}

// Let's go!
jQuery(document).ready(function() {
	double_margin();
});


