code: function convertCodePoints(regexp) {
  		return regexp.replace(/\\x\{([0-9a-fA-F]+)\}/g, function(m, chars) {
  			// pad to four hex digits
  			while (chars.length < 4) {
  				chars = '0' + chars;
  			}
  			return '\\u' + chars;
  		});
  	}
docs: Convert PCRE \x{ff} style code points used by PHP to JS \u00ff style code points. For background search for \u in http://www.pcre.org/pcre.txt.