You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xregexp-all.js 126KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308
  1. /***** xregexp.js *****/
  2. /*!
  3. * XRegExp v2.0.0
  4. * (c) 2007-2012 Steven Levithan <http://xregexp.com/>
  5. * MIT License
  6. */
  7. /**
  8. * XRegExp provides augmented, extensible JavaScript regular expressions. You get new syntax,
  9. * flags, and methods beyond what browsers support natively. XRegExp is also a regex utility belt
  10. * with tools to make your client-side grepping simpler and more powerful, while freeing you from
  11. * worrying about pesky cross-browser inconsistencies and the dubious `lastIndex` property. See
  12. * XRegExp's documentation (http://xregexp.com/) for more details.
  13. * @module xregexp
  14. * @requires N/A
  15. */
  16. var XRegExp;
  17. // Avoid running twice; that would reset tokens and could break references to native globals
  18. XRegExp = XRegExp || (function (undef) {
  19. "use strict";
  20. /*--------------------------------------
  21. * Private variables
  22. *------------------------------------*/
  23. var self,
  24. addToken,
  25. add,
  26. // Optional features; can be installed and uninstalled
  27. features = {
  28. natives: false,
  29. extensibility: false
  30. },
  31. // Store native methods to use and restore ("native" is an ES3 reserved keyword)
  32. nativ = {
  33. exec: RegExp.prototype.exec,
  34. test: RegExp.prototype.test,
  35. match: String.prototype.match,
  36. replace: String.prototype.replace,
  37. split: String.prototype.split
  38. },
  39. // Storage for fixed/extended native methods
  40. fixed = {},
  41. // Storage for cached regexes
  42. cache = {},
  43. // Storage for addon tokens
  44. tokens = [],
  45. // Token scopes
  46. defaultScope = "default",
  47. classScope = "class",
  48. // Regexes that match native regex syntax
  49. nativeTokens = {
  50. // Any native multicharacter token in default scope (includes octals, excludes character classes)
  51. "default": /^(?:\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|\(\?[:=!]|[?*+]\?|{\d+(?:,\d*)?}\??)/,
  52. // Any native multicharacter token in character class scope (includes octals)
  53. "class": /^(?:\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S]))/
  54. },
  55. // Any backreference in replacement strings
  56. replacementToken = /\$(?:{([\w$]+)}|(\d\d?|[\s\S]))/g,
  57. // Any character with a later instance in the string
  58. duplicateFlags = /([\s\S])(?=[\s\S]*\1)/g,
  59. // Any greedy/lazy quantifier
  60. quantifier = /^(?:[?*+]|{\d+(?:,\d*)?})\??/,
  61. // Check for correct `exec` handling of nonparticipating capturing groups
  62. compliantExecNpcg = nativ.exec.call(/()??/, "")[1] === undef,
  63. // Check for flag y support (Firefox 3+)
  64. hasNativeY = RegExp.prototype.sticky !== undef,
  65. // Used to kill infinite recursion during XRegExp construction
  66. isInsideConstructor = false,
  67. // Storage for known flags, including addon flags
  68. registeredFlags = "gim" + (hasNativeY ? "y" : "");
  69. /*--------------------------------------
  70. * Private helper functions
  71. *------------------------------------*/
  72. /**
  73. * Attaches XRegExp.prototype properties and named capture supporting data to a regex object.
  74. * @private
  75. * @param {RegExp} regex Regex to augment.
  76. * @param {Array} captureNames Array with capture names, or null.
  77. * @param {Boolean} [isNative] Whether the regex was created by `RegExp` rather than `XRegExp`.
  78. * @returns {RegExp} Augmented regex.
  79. */
  80. function augment(regex, captureNames, isNative) {
  81. var p;
  82. // Can't auto-inherit these since the XRegExp constructor returns a nonprimitive value
  83. for (p in self.prototype) {
  84. if (self.prototype.hasOwnProperty(p)) {
  85. regex[p] = self.prototype[p];
  86. }
  87. }
  88. regex.xregexp = {captureNames: captureNames, isNative: !!isNative};
  89. return regex;
  90. }
  91. /**
  92. * Returns native `RegExp` flags used by a regex object.
  93. * @private
  94. * @param {RegExp} regex Regex to check.
  95. * @returns {String} Native flags in use.
  96. */
  97. function getNativeFlags(regex) {
  98. //return nativ.exec.call(/\/([a-z]*)$/i, String(regex))[1];
  99. return (regex.global ? "g" : "") +
  100. (regex.ignoreCase ? "i" : "") +
  101. (regex.multiline ? "m" : "") +
  102. (regex.extended ? "x" : "") + // Proposed for ES6, included in AS3
  103. (regex.sticky ? "y" : ""); // Proposed for ES6, included in Firefox 3+
  104. }
  105. /**
  106. * Copies a regex object while preserving special properties for named capture and augmenting with
  107. * `XRegExp.prototype` methods. The copy has a fresh `lastIndex` property (set to zero). Allows
  108. * adding and removing flags while copying the regex.
  109. * @private
  110. * @param {RegExp} regex Regex to copy.
  111. * @param {String} [addFlags] Flags to be added while copying the regex.
  112. * @param {String} [removeFlags] Flags to be removed while copying the regex.
  113. * @returns {RegExp} Copy of the provided regex, possibly with modified flags.
  114. */
  115. function copy(regex, addFlags, removeFlags) {
  116. if (!self.isRegExp(regex)) {
  117. throw new TypeError("type RegExp expected");
  118. }
  119. var flags = nativ.replace.call(getNativeFlags(regex) + (addFlags || ""), duplicateFlags, "");
  120. if (removeFlags) {
  121. // Would need to escape `removeFlags` if this was public
  122. flags = nativ.replace.call(flags, new RegExp("[" + removeFlags + "]+", "g"), "");
  123. }
  124. if (regex.xregexp && !regex.xregexp.isNative) {
  125. // Compiling the current (rather than precompilation) source preserves the effects of nonnative source flags
  126. regex = augment(self(regex.source, flags),
  127. regex.xregexp.captureNames ? regex.xregexp.captureNames.slice(0) : null);
  128. } else {
  129. // Augment with `XRegExp.prototype` methods, but use native `RegExp` (avoid searching for special tokens)
  130. regex = augment(new RegExp(regex.source, flags), null, true);
  131. }
  132. return regex;
  133. }
  134. /*
  135. * Returns the last index at which a given value can be found in an array, or `-1` if it's not
  136. * present. The array is searched backwards.
  137. * @private
  138. * @param {Array} array Array to search.
  139. * @param {*} value Value to locate in the array.
  140. * @returns {Number} Last zero-based index at which the item is found, or -1.
  141. */
  142. function lastIndexOf(array, value) {
  143. var i = array.length;
  144. if (Array.prototype.lastIndexOf) {
  145. return array.lastIndexOf(value); // Use the native method if available
  146. }
  147. while (i--) {
  148. if (array[i] === value) {
  149. return i;
  150. }
  151. }
  152. return -1;
  153. }
  154. /**
  155. * Determines whether an object is of the specified type.
  156. * @private
  157. * @param {*} value Object to check.
  158. * @param {String} type Type to check for, in lowercase.
  159. * @returns {Boolean} Whether the object matches the type.
  160. */
  161. function isType(value, type) {
  162. return Object.prototype.toString.call(value).toLowerCase() === "[object " + type + "]";
  163. }
  164. /**
  165. * Prepares an options object from the given value.
  166. * @private
  167. * @param {String|Object} value Value to convert to an options object.
  168. * @returns {Object} Options object.
  169. */
  170. function prepareOptions(value) {
  171. value = value || {};
  172. if (value === "all" || value.all) {
  173. value = {natives: true, extensibility: true};
  174. } else if (isType(value, "string")) {
  175. value = self.forEach(value, /[^\s,]+/, function (m) {
  176. this[m] = true;
  177. }, {});
  178. }
  179. return value;
  180. }
  181. /**
  182. * Runs built-in/custom tokens in reverse insertion order, until a match is found.
  183. * @private
  184. * @param {String} pattern Original pattern from which an XRegExp object is being built.
  185. * @param {Number} pos Position to search for tokens within `pattern`.
  186. * @param {Number} scope Current regex scope.
  187. * @param {Object} context Context object assigned to token handler functions.
  188. * @returns {Object} Object with properties `output` (the substitution string returned by the
  189. * successful token handler) and `match` (the token's match array), or null.
  190. */
  191. function runTokens(pattern, pos, scope, context) {
  192. var i = tokens.length,
  193. result = null,
  194. match,
  195. t;
  196. // Protect against constructing XRegExps within token handler and trigger functions
  197. isInsideConstructor = true;
  198. // Must reset `isInsideConstructor`, even if a `trigger` or `handler` throws
  199. try {
  200. while (i--) { // Run in reverse order
  201. t = tokens[i];
  202. if ((t.scope === "all" || t.scope === scope) && (!t.trigger || t.trigger.call(context))) {
  203. t.pattern.lastIndex = pos;
  204. match = fixed.exec.call(t.pattern, pattern); // Fixed `exec` here allows use of named backreferences, etc.
  205. if (match && match.index === pos) {
  206. result = {
  207. output: t.handler.call(context, match, scope),
  208. match: match
  209. };
  210. break;
  211. }
  212. }
  213. }
  214. } catch (err) {
  215. throw err;
  216. } finally {
  217. isInsideConstructor = false;
  218. }
  219. return result;
  220. }
  221. /**
  222. * Enables or disables XRegExp syntax and flag extensibility.
  223. * @private
  224. * @param {Boolean} on `true` to enable; `false` to disable.
  225. */
  226. function setExtensibility(on) {
  227. self.addToken = addToken[on ? "on" : "off"];
  228. features.extensibility = on;
  229. }
  230. /**
  231. * Enables or disables native method overrides.
  232. * @private
  233. * @param {Boolean} on `true` to enable; `false` to disable.
  234. */
  235. function setNatives(on) {
  236. RegExp.prototype.exec = (on ? fixed : nativ).exec;
  237. RegExp.prototype.test = (on ? fixed : nativ).test;
  238. String.prototype.match = (on ? fixed : nativ).match;
  239. String.prototype.replace = (on ? fixed : nativ).replace;
  240. String.prototype.split = (on ? fixed : nativ).split;
  241. features.natives = on;
  242. }
  243. /*--------------------------------------
  244. * Constructor
  245. *------------------------------------*/
  246. /**
  247. * Creates an extended regular expression object for matching text with a pattern. Differs from a
  248. * native regular expression in that additional syntax and flags are supported. The returned object
  249. * is in fact a native `RegExp` and works with all native methods.
  250. * @class XRegExp
  251. * @constructor
  252. * @param {String|RegExp} pattern Regex pattern string, or an existing `RegExp` object to copy.
  253. * @param {String} [flags] Any combination of flags:
  254. * <li>`g` - global
  255. * <li>`i` - ignore case
  256. * <li>`m` - multiline anchors
  257. * <li>`n` - explicit capture
  258. * <li>`s` - dot matches all (aka singleline)
  259. * <li>`x` - free-spacing and line comments (aka extended)
  260. * <li>`y` - sticky (Firefox 3+ only)
  261. * Flags cannot be provided when constructing one `RegExp` from another.
  262. * @returns {RegExp} Extended regular expression object.
  263. * @example
  264. *
  265. * // With named capture and flag x
  266. * date = XRegExp('(?<year> [0-9]{4}) -? # year \n\
  267. * (?<month> [0-9]{2}) -? # month \n\
  268. * (?<day> [0-9]{2}) # day ', 'x');
  269. *
  270. * // Passing a regex object to copy it. The copy maintains special properties for named capture,
  271. * // is augmented with `XRegExp.prototype` methods, and has a fresh `lastIndex` property (set to
  272. * // zero). Native regexes are not recompiled using XRegExp syntax.
  273. * XRegExp(/regex/);
  274. */
  275. self = function (pattern, flags) {
  276. if (self.isRegExp(pattern)) {
  277. if (flags !== undef) {
  278. throw new TypeError("can't supply flags when constructing one RegExp from another");
  279. }
  280. return copy(pattern);
  281. }
  282. // Tokens become part of the regex construction process, so protect against infinite recursion
  283. // when an XRegExp is constructed within a token handler function
  284. if (isInsideConstructor) {
  285. throw new Error("can't call the XRegExp constructor within token definition functions");
  286. }
  287. var output = [],
  288. scope = defaultScope,
  289. tokenContext = {
  290. hasNamedCapture: false,
  291. captureNames: [],
  292. hasFlag: function (flag) {
  293. return flags.indexOf(flag) > -1;
  294. }
  295. },
  296. pos = 0,
  297. tokenResult,
  298. match,
  299. chr;
  300. pattern = pattern === undef ? "" : String(pattern);
  301. flags = flags === undef ? "" : String(flags);
  302. if (nativ.match.call(flags, duplicateFlags)) { // Don't use test/exec because they would update lastIndex
  303. throw new SyntaxError("invalid duplicate regular expression flag");
  304. }
  305. // Strip/apply leading mode modifier with any combination of flags except g or y: (?imnsx)
  306. pattern = nativ.replace.call(pattern, /^\(\?([\w$]+)\)/, function ($0, $1) {
  307. if (nativ.test.call(/[gy]/, $1)) {
  308. throw new SyntaxError("can't use flag g or y in mode modifier");
  309. }
  310. flags = nativ.replace.call(flags + $1, duplicateFlags, "");
  311. return "";
  312. });
  313. self.forEach(flags, /[\s\S]/, function (m) {
  314. if (registeredFlags.indexOf(m[0]) < 0) {
  315. throw new SyntaxError("invalid regular expression flag " + m[0]);
  316. }
  317. });
  318. while (pos < pattern.length) {
  319. // Check for custom tokens at the current position
  320. tokenResult = runTokens(pattern, pos, scope, tokenContext);
  321. if (tokenResult) {
  322. output.push(tokenResult.output);
  323. pos += (tokenResult.match[0].length || 1);
  324. } else {
  325. // Check for native tokens (except character classes) at the current position
  326. match = nativ.exec.call(nativeTokens[scope], pattern.slice(pos));
  327. if (match) {
  328. output.push(match[0]);
  329. pos += match[0].length;
  330. } else {
  331. chr = pattern.charAt(pos);
  332. if (chr === "[") {
  333. scope = classScope;
  334. } else if (chr === "]") {
  335. scope = defaultScope;
  336. }
  337. // Advance position by one character
  338. output.push(chr);
  339. ++pos;
  340. }
  341. }
  342. }
  343. return augment(new RegExp(output.join(""), nativ.replace.call(flags, /[^gimy]+/g, "")),
  344. tokenContext.hasNamedCapture ? tokenContext.captureNames : null);
  345. };
  346. /*--------------------------------------
  347. * Public methods/properties
  348. *------------------------------------*/
  349. // Installed and uninstalled states for `XRegExp.addToken`
  350. addToken = {
  351. on: function (regex, handler, options) {
  352. options = options || {};
  353. if (regex) {
  354. tokens.push({
  355. pattern: copy(regex, "g" + (hasNativeY ? "y" : "")),
  356. handler: handler,
  357. scope: options.scope || defaultScope,
  358. trigger: options.trigger || null
  359. });
  360. }
  361. // Providing `customFlags` with null `regex` and `handler` allows adding flags that do
  362. // nothing, but don't throw an error
  363. if (options.customFlags) {
  364. registeredFlags = nativ.replace.call(registeredFlags + options.customFlags, duplicateFlags, "");
  365. }
  366. },
  367. off: function () {
  368. throw new Error("extensibility must be installed before using addToken");
  369. }
  370. };
  371. /**
  372. * Extends or changes XRegExp syntax and allows custom flags. This is used internally and can be
  373. * used to create XRegExp addons. `XRegExp.install('extensibility')` must be run before calling
  374. * this function, or an error is thrown. If more than one token can match the same string, the last
  375. * added wins.
  376. * @memberOf XRegExp
  377. * @param {RegExp} regex Regex object that matches the new token.
  378. * @param {Function} handler Function that returns a new pattern string (using native regex syntax)
  379. * to replace the matched token within all future XRegExp regexes. Has access to persistent
  380. * properties of the regex being built, through `this`. Invoked with two arguments:
  381. * <li>The match array, with named backreference properties.
  382. * <li>The regex scope where the match was found.
  383. * @param {Object} [options] Options object with optional properties:
  384. * <li>`scope` {String} Scopes where the token applies: 'default', 'class', or 'all'.
  385. * <li>`trigger` {Function} Function that returns `true` when the token should be applied; e.g.,
  386. * if a flag is set. If `false` is returned, the matched string can be matched by other tokens.
  387. * Has access to persistent properties of the regex being built, through `this` (including
  388. * function `this.hasFlag`).
  389. * <li>`customFlags` {String} Nonnative flags used by the token's handler or trigger functions.
  390. * Prevents XRegExp from throwing an invalid flag error when the specified flags are used.
  391. * @example
  392. *
  393. * // Basic usage: Adds \a for ALERT character
  394. * XRegExp.addToken(
  395. * /\\a/,
  396. * function () {return '\\x07';},
  397. * {scope: 'all'}
  398. * );
  399. * XRegExp('\\a[\\a-\\n]+').test('\x07\n\x07'); // -> true
  400. */
  401. self.addToken = addToken.off;
  402. /**
  403. * Caches and returns the result of calling `XRegExp(pattern, flags)`. On any subsequent call with
  404. * the same pattern and flag combination, the cached copy is returned.
  405. * @memberOf XRegExp
  406. * @param {String} pattern Regex pattern string.
  407. * @param {String} [flags] Any combination of XRegExp flags.
  408. * @returns {RegExp} Cached XRegExp object.
  409. * @example
  410. *
  411. * while (match = XRegExp.cache('.', 'gs').exec(str)) {
  412. * // The regex is compiled once only
  413. * }
  414. */
  415. self.cache = function (pattern, flags) {
  416. var key = pattern + "/" + (flags || "");
  417. return cache[key] || (cache[key] = self(pattern, flags));
  418. };
  419. /**
  420. * Escapes any regular expression metacharacters, for use when matching literal strings. The result
  421. * can safely be used at any point within a regex that uses any flags.
  422. * @memberOf XRegExp
  423. * @param {String} str String to escape.
  424. * @returns {String} String with regex metacharacters escaped.
  425. * @example
  426. *
  427. * XRegExp.escape('Escaped? <.>');
  428. * // -> 'Escaped\?\ <\.>'
  429. */
  430. self.escape = function (str) {
  431. return nativ.replace.call(str, /[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
  432. };
  433. /**
  434. * Executes a regex search in a specified string. Returns a match array or `null`. If the provided
  435. * regex uses named capture, named backreference properties are included on the match array.
  436. * Optional `pos` and `sticky` arguments specify the search start position, and whether the match
  437. * must start at the specified position only. The `lastIndex` property of the provided regex is not
  438. * used, but is updated for compatibility. Also fixes browser bugs compared to the native
  439. * `RegExp.prototype.exec` and can be used reliably cross-browser.
  440. * @memberOf XRegExp
  441. * @param {String} str String to search.
  442. * @param {RegExp} regex Regex to search with.
  443. * @param {Number} [pos=0] Zero-based index at which to start the search.
  444. * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position
  445. * only. The string `'sticky'` is accepted as an alternative to `true`.
  446. * @returns {Array} Match array with named backreference properties, or null.
  447. * @example
  448. *
  449. * // Basic use, with named backreference
  450. * var match = XRegExp.exec('U+2620', XRegExp('U\\+(?<hex>[0-9A-F]{4})'));
  451. * match.hex; // -> '2620'
  452. *
  453. * // With pos and sticky, in a loop
  454. * var pos = 2, result = [], match;
  455. * while (match = XRegExp.exec('<1><2><3><4>5<6>', /<(\d)>/, pos, 'sticky')) {
  456. * result.push(match[1]);
  457. * pos = match.index + match[0].length;
  458. * }
  459. * // result -> ['2', '3', '4']
  460. */
  461. self.exec = function (str, regex, pos, sticky) {
  462. var r2 = copy(regex, "g" + (sticky && hasNativeY ? "y" : ""), (sticky === false ? "y" : "")),
  463. match;
  464. r2.lastIndex = pos = pos || 0;
  465. match = fixed.exec.call(r2, str); // Fixed `exec` required for `lastIndex` fix, etc.
  466. if (sticky && match && match.index !== pos) {
  467. match = null;
  468. }
  469. if (regex.global) {
  470. regex.lastIndex = match ? r2.lastIndex : 0;
  471. }
  472. return match;
  473. };
  474. /**
  475. * Executes a provided function once per regex match.
  476. * @memberOf XRegExp
  477. * @param {String} str String to search.
  478. * @param {RegExp} regex Regex to search with.
  479. * @param {Function} callback Function to execute for each match. Invoked with four arguments:
  480. * <li>The match array, with named backreference properties.
  481. * <li>The zero-based match index.
  482. * <li>The string being traversed.
  483. * <li>The regex object being used to traverse the string.
  484. * @param {*} [context] Object to use as `this` when executing `callback`.
  485. * @returns {*} Provided `context` object.
  486. * @example
  487. *
  488. * // Extracts every other digit from a string
  489. * XRegExp.forEach('1a2345', /\d/, function (match, i) {
  490. * if (i % 2) this.push(+match[0]);
  491. * }, []);
  492. * // -> [2, 4]
  493. */
  494. self.forEach = function (str, regex, callback, context) {
  495. var pos = 0,
  496. i = -1,
  497. match;
  498. while ((match = self.exec(str, regex, pos))) {
  499. callback.call(context, match, ++i, str, regex);
  500. pos = match.index + (match[0].length || 1);
  501. }
  502. return context;
  503. };
  504. /**
  505. * Copies a regex object and adds flag `g`. The copy maintains special properties for named
  506. * capture, is augmented with `XRegExp.prototype` methods, and has a fresh `lastIndex` property
  507. * (set to zero). Native regexes are not recompiled using XRegExp syntax.
  508. * @memberOf XRegExp
  509. * @param {RegExp} regex Regex to globalize.
  510. * @returns {RegExp} Copy of the provided regex with flag `g` added.
  511. * @example
  512. *
  513. * var globalCopy = XRegExp.globalize(/regex/);
  514. * globalCopy.global; // -> true
  515. */
  516. self.globalize = function (regex) {
  517. return copy(regex, "g");
  518. };
  519. /**
  520. * Installs optional features according to the specified options.
  521. * @memberOf XRegExp
  522. * @param {Object|String} options Options object or string.
  523. * @example
  524. *
  525. * // With an options object
  526. * XRegExp.install({
  527. * // Overrides native regex methods with fixed/extended versions that support named
  528. * // backreferences and fix numerous cross-browser bugs
  529. * natives: true,
  530. *
  531. * // Enables extensibility of XRegExp syntax and flags
  532. * extensibility: true
  533. * });
  534. *
  535. * // With an options string
  536. * XRegExp.install('natives extensibility');
  537. *
  538. * // Using a shortcut to install all optional features
  539. * XRegExp.install('all');
  540. */
  541. self.install = function (options) {
  542. options = prepareOptions(options);
  543. if (!features.natives && options.natives) {
  544. setNatives(true);
  545. }
  546. if (!features.extensibility && options.extensibility) {
  547. setExtensibility(true);
  548. }
  549. };
  550. /**
  551. * Checks whether an individual optional feature is installed.
  552. * @memberOf XRegExp
  553. * @param {String} feature Name of the feature to check. One of:
  554. * <li>`natives`
  555. * <li>`extensibility`
  556. * @returns {Boolean} Whether the feature is installed.
  557. * @example
  558. *
  559. * XRegExp.isInstalled('natives');
  560. */
  561. self.isInstalled = function (feature) {
  562. return !!(features[feature]);
  563. };
  564. /**
  565. * Returns `true` if an object is a regex; `false` if it isn't. This works correctly for regexes
  566. * created in another frame, when `instanceof` and `constructor` checks would fail.
  567. * @memberOf XRegExp
  568. * @param {*} value Object to check.
  569. * @returns {Boolean} Whether the object is a `RegExp` object.
  570. * @example
  571. *
  572. * XRegExp.isRegExp('string'); // -> false
  573. * XRegExp.isRegExp(/regex/i); // -> true
  574. * XRegExp.isRegExp(RegExp('^', 'm')); // -> true
  575. * XRegExp.isRegExp(XRegExp('(?s).')); // -> true
  576. */
  577. self.isRegExp = function (value) {
  578. return isType(value, "regexp");
  579. };
  580. /**
  581. * Retrieves the matches from searching a string using a chain of regexes that successively search
  582. * within previous matches. The provided `chain` array can contain regexes and objects with `regex`
  583. * and `backref` properties. When a backreference is specified, the named or numbered backreference
  584. * is passed forward to the next regex or returned.
  585. * @memberOf XRegExp
  586. * @param {String} str String to search.
  587. * @param {Array} chain Regexes that each search for matches within preceding results.
  588. * @returns {Array} Matches by the last regex in the chain, or an empty array.
  589. * @example
  590. *
  591. * // Basic usage; matches numbers within <b> tags
  592. * XRegExp.matchChain('1 <b>2</b> 3 <b>4 a 56</b>', [
  593. * XRegExp('(?is)<b>.*?</b>'),
  594. * /\d+/
  595. * ]);
  596. * // -> ['2', '4', '56']
  597. *
  598. * // Passing forward and returning specific backreferences
  599. * html = '<a href="http://xregexp.com/api/">XRegExp</a>\
  600. * <a href="http://www.google.com/">Google</a>';
  601. * XRegExp.matchChain(html, [
  602. * {regex: /<a href="([^"]+)">/i, backref: 1},
  603. * {regex: XRegExp('(?i)^https?://(?<domain>[^/?#]+)'), backref: 'domain'}
  604. * ]);
  605. * // -> ['xregexp.com', 'www.google.com']
  606. */
  607. self.matchChain = function (str, chain) {
  608. return (function recurseChain(values, level) {
  609. var item = chain[level].regex ? chain[level] : {regex: chain[level]},
  610. matches = [],
  611. addMatch = function (match) {
  612. matches.push(item.backref ? (match[item.backref] || "") : match[0]);
  613. },
  614. i;
  615. for (i = 0; i < values.length; ++i) {
  616. self.forEach(values[i], item.regex, addMatch);
  617. }
  618. return ((level === chain.length - 1) || !matches.length) ?
  619. matches :
  620. recurseChain(matches, level + 1);
  621. }([str], 0));
  622. };
  623. /**
  624. * Returns a new string with one or all matches of a pattern replaced. The pattern can be a string
  625. * or regex, and the replacement can be a string or a function to be called for each match. To
  626. * perform a global search and replace, use the optional `scope` argument or include flag `g` if
  627. * using a regex. Replacement strings can use `${n}` for named and numbered backreferences.
  628. * Replacement functions can use named backreferences via `arguments[0].name`. Also fixes browser
  629. * bugs compared to the native `String.prototype.replace` and can be used reliably cross-browser.
  630. * @memberOf XRegExp
  631. * @param {String} str String to search.
  632. * @param {RegExp|String} search Search pattern to be replaced.
  633. * @param {String|Function} replacement Replacement string or a function invoked to create it.
  634. * Replacement strings can include special replacement syntax:
  635. * <li>$$ - Inserts a literal '$'.
  636. * <li>$&, $0 - Inserts the matched substring.
  637. * <li>$` - Inserts the string that precedes the matched substring (left context).
  638. * <li>$' - Inserts the string that follows the matched substring (right context).
  639. * <li>$n, $nn - Where n/nn are digits referencing an existent capturing group, inserts
  640. * backreference n/nn.
  641. * <li>${n} - Where n is a name or any number of digits that reference an existent capturing
  642. * group, inserts backreference n.
  643. * Replacement functions are invoked with three or more arguments:
  644. * <li>The matched substring (corresponds to $& above). Named backreferences are accessible as
  645. * properties of this first argument.
  646. * <li>0..n arguments, one for each backreference (corresponding to $1, $2, etc. above).
  647. * <li>The zero-based index of the match within the total search string.
  648. * <li>The total string being searched.
  649. * @param {String} [scope='one'] Use 'one' to replace the first match only, or 'all'. If not
  650. * explicitly specified and using a regex with flag `g`, `scope` is 'all'.
  651. * @returns {String} New string with one or all matches replaced.
  652. * @example
  653. *
  654. * // Regex search, using named backreferences in replacement string
  655. * var name = XRegExp('(?<first>\\w+) (?<last>\\w+)');
  656. * XRegExp.replace('John Smith', name, '${last}, ${first}');
  657. * // -> 'Smith, John'
  658. *
  659. * // Regex search, using named backreferences in replacement function
  660. * XRegExp.replace('John Smith', name, function (match) {
  661. * return match.last + ', ' + match.first;
  662. * });
  663. * // -> 'Smith, John'
  664. *
  665. * // Global string search/replacement
  666. * XRegExp.replace('RegExp builds RegExps', 'RegExp', 'XRegExp', 'all');
  667. * // -> 'XRegExp builds XRegExps'
  668. */
  669. self.replace = function (str, search, replacement, scope) {
  670. var isRegex = self.isRegExp(search),
  671. search2 = search,
  672. result;
  673. if (isRegex) {
  674. if (scope === undef && search.global) {
  675. scope = "all"; // Follow flag g when `scope` isn't explicit
  676. }
  677. // Note that since a copy is used, `search`'s `lastIndex` isn't updated *during* replacement iterations
  678. search2 = copy(search, scope === "all" ? "g" : "", scope === "all" ? "" : "g");
  679. } else if (scope === "all") {
  680. search2 = new RegExp(self.escape(String(search)), "g");
  681. }
  682. result = fixed.replace.call(String(str), search2, replacement); // Fixed `replace` required for named backreferences, etc.
  683. if (isRegex && search.global) {
  684. search.lastIndex = 0; // Fixes IE, Safari bug (last tested IE 9, Safari 5.1)
  685. }
  686. return result;
  687. };
  688. /**
  689. * Splits a string into an array of strings using a regex or string separator. Matches of the
  690. * separator are not included in the result array. However, if `separator` is a regex that contains
  691. * capturing groups, backreferences are spliced into the result each time `separator` is matched.
  692. * Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably
  693. * cross-browser.
  694. * @memberOf XRegExp
  695. * @param {String} str String to split.
  696. * @param {RegExp|String} separator Regex or string to use for separating the string.
  697. * @param {Number} [limit] Maximum number of items to include in the result array.
  698. * @returns {Array} Array of substrings.
  699. * @example
  700. *
  701. * // Basic use
  702. * XRegExp.split('a b c', ' ');
  703. * // -> ['a', 'b', 'c']
  704. *
  705. * // With limit
  706. * XRegExp.split('a b c', ' ', 2);
  707. * // -> ['a', 'b']
  708. *
  709. * // Backreferences in result array
  710. * XRegExp.split('..word1..', /([a-z]+)(\d+)/i);
  711. * // -> ['..', 'word', '1', '..']
  712. */
  713. self.split = function (str, separator, limit) {
  714. return fixed.split.call(str, separator, limit);
  715. };
  716. /**
  717. * Executes a regex search in a specified string. Returns `true` or `false`. Optional `pos` and
  718. * `sticky` arguments specify the search start position, and whether the match must start at the
  719. * specified position only. The `lastIndex` property of the provided regex is not used, but is
  720. * updated for compatibility. Also fixes browser bugs compared to the native
  721. * `RegExp.prototype.test` and can be used reliably cross-browser.
  722. * @memberOf XRegExp
  723. * @param {String} str String to search.
  724. * @param {RegExp} regex Regex to search with.
  725. * @param {Number} [pos=0] Zero-based index at which to start the search.
  726. * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position
  727. * only. The string `'sticky'` is accepted as an alternative to `true`.
  728. * @returns {Boolean} Whether the regex matched the provided value.
  729. * @example
  730. *
  731. * // Basic use
  732. * XRegExp.test('abc', /c/); // -> true
  733. *
  734. * // With pos and sticky
  735. * XRegExp.test('abc', /c/, 0, 'sticky'); // -> false
  736. */
  737. self.test = function (str, regex, pos, sticky) {
  738. // Do this the easy way :-)
  739. return !!self.exec(str, regex, pos, sticky);
  740. };
  741. /**
  742. * Uninstalls optional features according to the specified options.
  743. * @memberOf XRegExp
  744. * @param {Object|String} options Options object or string.
  745. * @example
  746. *
  747. * // With an options object
  748. * XRegExp.uninstall({
  749. * // Restores native regex methods
  750. * natives: true,
  751. *
  752. * // Disables additional syntax and flag extensions
  753. * extensibility: true
  754. * });
  755. *
  756. * // With an options string
  757. * XRegExp.uninstall('natives extensibility');
  758. *
  759. * // Using a shortcut to uninstall all optional features
  760. * XRegExp.uninstall('all');
  761. */
  762. self.uninstall = function (options) {
  763. options = prepareOptions(options);
  764. if (features.natives && options.natives) {
  765. setNatives(false);
  766. }
  767. if (features.extensibility && options.extensibility) {
  768. setExtensibility(false);
  769. }
  770. };
  771. /**
  772. * Returns an XRegExp object that is the union of the given patterns. Patterns can be provided as
  773. * regex objects or strings. Metacharacters are escaped in patterns provided as strings.
  774. * Backreferences in provided regex objects are automatically renumbered to work correctly. Native
  775. * flags used by provided regexes are ignored in favor of the `flags` argument.
  776. * @memberOf XRegExp
  777. * @param {Array} patterns Regexes and strings to combine.
  778. * @param {String} [flags] Any combination of XRegExp flags.
  779. * @returns {RegExp} Union of the provided regexes and strings.
  780. * @example
  781. *
  782. * XRegExp.union(['a+b*c', /(dogs)\1/, /(cats)\1/], 'i');
  783. * // -> /a\+b\*c|(dogs)\1|(cats)\2/i
  784. *
  785. * XRegExp.union([XRegExp('(?<pet>dogs)\\k<pet>'), XRegExp('(?<pet>cats)\\k<pet>')]);
  786. * // -> XRegExp('(?<pet>dogs)\\k<pet>|(?<pet>cats)\\k<pet>')
  787. */
  788. self.union = function (patterns, flags) {
  789. var parts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*]/g,
  790. numCaptures = 0,
  791. numPriorCaptures,
  792. captureNames,
  793. rewrite = function (match, paren, backref) {
  794. var name = captureNames[numCaptures - numPriorCaptures];
  795. if (paren) { // Capturing group
  796. ++numCaptures;
  797. if (name) { // If the current capture has a name
  798. return "(?<" + name + ">";
  799. }
  800. } else if (backref) { // Backreference
  801. return "\\" + (+backref + numPriorCaptures);
  802. }
  803. return match;
  804. },
  805. output = [],
  806. pattern,
  807. i;
  808. if (!(isType(patterns, "array") && patterns.length)) {
  809. throw new TypeError("patterns must be a nonempty array");
  810. }
  811. for (i = 0; i < patterns.length; ++i) {
  812. pattern = patterns[i];
  813. if (self.isRegExp(pattern)) {
  814. numPriorCaptures = numCaptures;
  815. captureNames = (pattern.xregexp && pattern.xregexp.captureNames) || [];
  816. // Rewrite backreferences. Passing to XRegExp dies on octals and ensures patterns
  817. // are independently valid; helps keep this simple. Named captures are put back
  818. output.push(self(pattern.source).source.replace(parts, rewrite));
  819. } else {
  820. output.push(self.escape(pattern));
  821. }
  822. }
  823. return self(output.join("|"), flags);
  824. };
  825. /**
  826. * The XRegExp version number.
  827. * @static
  828. * @memberOf XRegExp
  829. * @type String
  830. */
  831. self.version = "2.0.0";
  832. /*--------------------------------------
  833. * Fixed/extended native methods
  834. *------------------------------------*/
  835. /**
  836. * Adds named capture support (with backreferences returned as `result.name`), and fixes browser
  837. * bugs in the native `RegExp.prototype.exec`. Calling `XRegExp.install('natives')` uses this to
  838. * override the native method. Use via `XRegExp.exec` without overriding natives.
  839. * @private
  840. * @param {String} str String to search.
  841. * @returns {Array} Match array with named backreference properties, or null.
  842. */
  843. fixed.exec = function (str) {
  844. var match, name, r2, origLastIndex, i;
  845. if (!this.global) {
  846. origLastIndex = this.lastIndex;
  847. }
  848. match = nativ.exec.apply(this, arguments);
  849. if (match) {
  850. // Fix browsers whose `exec` methods don't consistently return `undefined` for
  851. // nonparticipating capturing groups
  852. if (!compliantExecNpcg && match.length > 1 && lastIndexOf(match, "") > -1) {
  853. r2 = new RegExp(this.source, nativ.replace.call(getNativeFlags(this), "g", ""));
  854. // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed
  855. // matching due to characters outside the match
  856. nativ.replace.call(String(str).slice(match.index), r2, function () {
  857. var i;
  858. for (i = 1; i < arguments.length - 2; ++i) {
  859. if (arguments[i] === undef) {
  860. match[i] = undef;
  861. }
  862. }
  863. });
  864. }
  865. // Attach named capture properties
  866. if (this.xregexp && this.xregexp.captureNames) {
  867. for (i = 1; i < match.length; ++i) {
  868. name = this.xregexp.captureNames[i - 1];
  869. if (name) {
  870. match[name] = match[i];
  871. }
  872. }
  873. }
  874. // Fix browsers that increment `lastIndex` after zero-length matches
  875. if (this.global && !match[0].length && (this.lastIndex > match.index)) {
  876. this.lastIndex = match.index;
  877. }
  878. }
  879. if (!this.global) {
  880. this.lastIndex = origLastIndex; // Fixes IE, Opera bug (last tested IE 9, Opera 11.6)
  881. }
  882. return match;
  883. };
  884. /**
  885. * Fixes browser bugs in the native `RegExp.prototype.test`. Calling `XRegExp.install('natives')`
  886. * uses this to override the native method.
  887. * @private
  888. * @param {String} str String to search.
  889. * @returns {Boolean} Whether the regex matched the provided value.
  890. */
  891. fixed.test = function (str) {
  892. // Do this the easy way :-)
  893. return !!fixed.exec.call(this, str);
  894. };
  895. /**
  896. * Adds named capture support (with backreferences returned as `result.name`), and fixes browser
  897. * bugs in the native `String.prototype.match`. Calling `XRegExp.install('natives')` uses this to
  898. * override the native method.
  899. * @private
  900. * @param {RegExp} regex Regex to search with.
  901. * @returns {Array} If `regex` uses flag g, an array of match strings or null. Without flag g, the
  902. * result of calling `regex.exec(this)`.
  903. */
  904. fixed.match = function (regex) {
  905. if (!self.isRegExp(regex)) {
  906. regex = new RegExp(regex); // Use native `RegExp`
  907. } else if (regex.global) {
  908. var result = nativ.match.apply(this, arguments);
  909. regex.lastIndex = 0; // Fixes IE bug
  910. return result;
  911. }
  912. return fixed.exec.call(regex, this);
  913. };
  914. /**
  915. * Adds support for `${n}` tokens for named and numbered backreferences in replacement text, and
  916. * provides named backreferences to replacement functions as `arguments[0].name`. Also fixes
  917. * browser bugs in replacement text syntax when performing a replacement using a nonregex search
  918. * value, and the value of a replacement regex's `lastIndex` property during replacement iterations
  919. * and upon completion. Note that this doesn't support SpiderMonkey's proprietary third (`flags`)
  920. * argument. Calling `XRegExp.install('natives')` uses this to override the native method. Use via
  921. * `XRegExp.replace` without overriding natives.
  922. * @private
  923. * @param {RegExp|String} search Search pattern to be replaced.
  924. * @param {String|Function} replacement Replacement string or a function invoked to create it.
  925. * @returns {String} New string with one or all matches replaced.
  926. */
  927. fixed.replace = function (search, replacement) {
  928. var isRegex = self.isRegExp(search), captureNames, result, str, origLastIndex;
  929. if (isRegex) {
  930. if (search.xregexp) {
  931. captureNames = search.xregexp.captureNames;
  932. }
  933. if (!search.global) {
  934. origLastIndex = search.lastIndex;
  935. }
  936. } else {
  937. search += "";
  938. }
  939. if (isType(replacement, "function")) {
  940. result = nativ.replace.call(String(this), search, function () {
  941. var args = arguments, i;
  942. if (captureNames) {
  943. // Change the `arguments[0]` string primitive to a `String` object that can store properties
  944. args[0] = new String(args[0]);
  945. // Store named backreferences on the first argument
  946. for (i = 0; i < captureNames.length; ++i) {
  947. if (captureNames[i]) {
  948. args[0][captureNames[i]] = args[i + 1];
  949. }
  950. }
  951. }
  952. // Update `lastIndex` before calling `replacement`.
  953. // Fixes IE, Chrome, Firefox, Safari bug (last tested IE 9, Chrome 17, Firefox 11, Safari 5.1)
  954. if (isRegex && search.global) {
  955. search.lastIndex = args[args.length - 2] + args[0].length;
  956. }
  957. return replacement.apply(null, args);
  958. });
  959. } else {
  960. str = String(this); // Ensure `args[args.length - 1]` will be a string when given nonstring `this`
  961. result = nativ.replace.call(str, search, function () {
  962. var args = arguments; // Keep this function's `arguments` available through closure
  963. return nativ.replace.call(String(replacement), replacementToken, function ($0, $1, $2) {
  964. var n;
  965. // Named or numbered backreference with curly brackets
  966. if ($1) {
  967. /* XRegExp behavior for `${n}`:
  968. * 1. Backreference to numbered capture, where `n` is 1+ digits. `0`, `00`, etc. is the entire match.
  969. * 2. Backreference to named capture `n`, if it exists and is not a number overridden by numbered capture.
  970. * 3. Otherwise, it's an error.
  971. */
  972. n = +$1; // Type-convert; drop leading zeros
  973. if (n <= args.length - 3) {
  974. return args[n] || "";
  975. }
  976. n = captureNames ? lastIndexOf(captureNames, $1) : -1;
  977. if (n < 0) {
  978. throw new SyntaxError("backreference to undefined group " + $0);
  979. }
  980. return args[n + 1] || "";
  981. }
  982. // Else, special variable or numbered backreference (without curly brackets)
  983. if ($2 === "$") return "$";
  984. if ($2 === "&" || +$2 === 0) return args[0]; // $&, $0 (not followed by 1-9), $00
  985. if ($2 === "`") return args[args.length - 1].slice(0, args[args.length - 2]);
  986. if ($2 === "'") return args[args.length - 1].slice(args[args.length - 2] + args[0].length);
  987. // Else, numbered backreference (without curly brackets)
  988. $2 = +$2; // Type-convert; drop leading zero
  989. /* XRegExp behavior:
  990. * - Backreferences without curly brackets end after 1 or 2 digits. Use `${..}` for more digits.
  991. * - `$1` is an error if there are no capturing groups.
  992. * - `$10` is an error if there are less than 10 capturing groups. Use `${1}0` instead.
  993. * - `$01` is equivalent to `$1` if a capturing group exists, otherwise it's an error.
  994. * - `$0` (not followed by 1-9), `$00`, and `$&` are the entire match.
  995. * Native behavior, for comparison:
  996. * - Backreferences end after 1 or 2 digits. Cannot use backreference to capturing group 100+.
  997. * - `$1` is a literal `$1` if there are no capturing groups.
  998. * - `$10` is `$1` followed by a literal `0` if there are less than 10 capturing groups.
  999. * - `$01` is equivalent to `$1` if a capturing group exists, otherwise it's a literal `$01`.
  1000. * - `$0` is a literal `$0`. `$&` is the entire match.
  1001. */
  1002. if (!isNaN($2)) {
  1003. if ($2 > args.length - 3) {
  1004. throw new SyntaxError("backreference to undefined group " + $0);
  1005. }
  1006. return args[$2] || "";
  1007. }
  1008. throw new SyntaxError("invalid token " + $0);
  1009. });
  1010. });
  1011. }
  1012. if (isRegex) {
  1013. if (search.global) {
  1014. search.lastIndex = 0; // Fixes IE, Safari bug (last tested IE 9, Safari 5.1)
  1015. } else {
  1016. search.lastIndex = origLastIndex; // Fixes IE, Opera bug (last tested IE 9, Opera 11.6)
  1017. }
  1018. }
  1019. return result;
  1020. };
  1021. /**
  1022. * Fixes browser bugs in the native `String.prototype.split`. Calling `XRegExp.install('natives')`
  1023. * uses this to override the native method. Use via `XRegExp.split` without overriding natives.
  1024. * @private
  1025. * @param {RegExp|String} separator Regex or string to use for separating the string.
  1026. * @param {Number} [limit] Maximum number of items to include in the result array.
  1027. * @returns {Array} Array of substrings.
  1028. */
  1029. fixed.split = function (separator, limit) {
  1030. if (!self.isRegExp(separator)) {
  1031. return nativ.split.apply(this, arguments); // use faster native method
  1032. }
  1033. var str = String(this),
  1034. origLastIndex = separator.lastIndex,
  1035. output = [],
  1036. lastLastIndex = 0,
  1037. lastLength;
  1038. /* Values for `limit`, per the spec:
  1039. * If undefined: pow(2,32) - 1
  1040. * If 0, Infinity, or NaN: 0
  1041. * If positive number: limit = floor(limit); if (limit >= pow(2,32)) limit -= pow(2,32);
  1042. * If negative number: pow(2,32) - floor(abs(limit))
  1043. * If other: Type-convert, then use the above rules
  1044. */
  1045. limit = (limit === undef ? -1 : limit) >>> 0;
  1046. self.forEach(str, separator, function (match) {
  1047. if ((match.index + match[0].length) > lastLastIndex) { // != `if (match[0].length)`
  1048. output.push(str.slice(lastLastIndex, match.index));
  1049. if (match.length > 1 && match.index < str.length) {
  1050. Array.prototype.push.apply(output, match.slice(1));
  1051. }
  1052. lastLength = match[0].length;
  1053. lastLastIndex = match.index + lastLength;
  1054. }
  1055. });
  1056. if (lastLastIndex === str.length) {
  1057. if (!nativ.test.call(separator, "") || lastLength) {
  1058. output.push("");
  1059. }
  1060. } else {
  1061. output.push(str.slice(lastLastIndex));
  1062. }
  1063. separator.lastIndex = origLastIndex;
  1064. return output.length > limit ? output.slice(0, limit) : output;
  1065. };
  1066. /*--------------------------------------
  1067. * Built-in tokens
  1068. *------------------------------------*/
  1069. // Shortcut
  1070. add = addToken.on;
  1071. /* Letter identity escapes that natively match literal characters: \p, \P, etc.
  1072. * Should be SyntaxErrors but are allowed in web reality. XRegExp makes them errors for cross-
  1073. * browser consistency and to reserve their syntax, but lets them be superseded by XRegExp addons.
  1074. */
  1075. add(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4})|x(?![\dA-Fa-f]{2}))/,
  1076. function (match, scope) {
  1077. // \B is allowed in default scope only
  1078. if (match[1] === "B" && scope === defaultScope) {
  1079. return match[0];
  1080. }
  1081. throw new SyntaxError("invalid escape " + match[0]);
  1082. },
  1083. {scope: "all"});
  1084. /* Empty character class: [] or [^]
  1085. * Fixes a critical cross-browser syntax inconsistency. Unless this is standardized (per the spec),
  1086. * regex syntax can't be accurately parsed because character class endings can't be determined.
  1087. */
  1088. add(/\[(\^?)]/,
  1089. function (match) {
  1090. // For cross-browser compatibility with ES3, convert [] to \b\B and [^] to [\s\S].
  1091. // (?!) should work like \b\B, but is unreliable in Firefox
  1092. return match[1] ? "[\\s\\S]" : "\\b\\B";
  1093. });
  1094. /* Comment pattern: (?# )
  1095. * Inline comments are an alternative to the line comments allowed in free-spacing mode (flag x).
  1096. */
  1097. add(/(?:\(\?#[^)]*\))+/,
  1098. function (match) {
  1099. // Keep tokens separated unless the following token is a quantifier
  1100. return nativ.test.call(quantifier, match.input.slice(match.index + match[0].length)) ? "" : "(?:)";
  1101. });
  1102. /* Named backreference: \k<name>
  1103. * Backreference names can use the characters A-Z, a-z, 0-9, _, and $ only.
  1104. */
  1105. add(/\\k<([\w$]+)>/,
  1106. function (match) {
  1107. var index = isNaN(match[1]) ? (lastIndexOf(this.captureNames, match[1]) + 1) : +match[1],
  1108. endIndex = match.index + match[0].length;
  1109. if (!index || index > this.captureNames.length) {
  1110. throw new SyntaxError("backreference to undefined group " + match[0]);
  1111. }
  1112. // Keep backreferences separate from subsequent literal numbers
  1113. return "\\" + index + (
  1114. endIndex === match.input.length || isNaN(match.input.charAt(endIndex)) ? "" : "(?:)"
  1115. );
  1116. });
  1117. /* Whitespace and line comments, in free-spacing mode (aka extended mode, flag x) only.
  1118. */
  1119. add(/(?:\s+|#.*)+/,
  1120. function (match) {
  1121. // Keep tokens separated unless the following token is a quantifier
  1122. return nativ.test.call(quantifier, match.input.slice(match.index + match[0].length)) ? "" : "(?:)";
  1123. },
  1124. {
  1125. trigger: function () {
  1126. return this.hasFlag("x");
  1127. },
  1128. customFlags: "x"
  1129. });
  1130. /* Dot, in dotall mode (aka singleline mode, flag s) only.
  1131. */
  1132. add(/\./,
  1133. function () {
  1134. return "[\\s\\S]";
  1135. },
  1136. {
  1137. trigger: function () {
  1138. return this.hasFlag("s");
  1139. },
  1140. customFlags: "s"
  1141. });
  1142. /* Named capturing group; match the opening delimiter only: (?<name>
  1143. * Capture names can use the characters A-Z, a-z, 0-9, _, and $ only. Names can't be integers.
  1144. * Supports Python-style (?P<name> as an alternate syntax to avoid issues in recent Opera (which
  1145. * natively supports the Python-style syntax). Otherwise, XRegExp might treat numbered
  1146. * backreferences to Python-style named capture as octals.
  1147. */
  1148. add(/\(\?P?<([\w$]+)>/,
  1149. function (match) {
  1150. if (!isNaN(match[1])) {
  1151. // Avoid incorrect lookups, since named backreferences are added to match arrays
  1152. throw new SyntaxError("can't use integer as capture name " + match[0]);
  1153. }
  1154. this.captureNames.push(match[1]);
  1155. this.hasNamedCapture = true;
  1156. return "(";
  1157. });
  1158. /* Numbered backreference or octal, plus any following digits: \0, \11, etc.
  1159. * Octals except \0 not followed by 0-9 and backreferences to unopened capture groups throw an
  1160. * error. Other matches are returned unaltered. IE <= 8 doesn't support backreferences greater than
  1161. * \99 in regex syntax.
  1162. */
  1163. add(/\\(\d+)/,
  1164. function (match, scope) {
  1165. if (!(scope === defaultScope && /^[1-9]/.test(match[1]) && +match[1] <= this.captureNames.length) &&
  1166. match[1] !== "0") {
  1167. throw new SyntaxError("can't use octal escape or backreference to undefined group " + match[0]);
  1168. }
  1169. return match[0];
  1170. },
  1171. {scope: "all"});
  1172. /* Capturing group; match the opening parenthesis only.
  1173. * Required for support of named capturing groups. Also adds explicit capture mode (flag n).
  1174. */
  1175. add(/\((?!\?)/,
  1176. function () {
  1177. if (this.hasFlag("n")) {
  1178. return "(?:";
  1179. }
  1180. this.captureNames.push(null);
  1181. return "(";
  1182. },
  1183. {customFlags: "n"});
  1184. /*--------------------------------------
  1185. * Expose XRegExp
  1186. *------------------------------------*/
  1187. // For CommonJS enviroments
  1188. if (typeof exports !== "undefined") {
  1189. exports.XRegExp = self;
  1190. }
  1191. return self;
  1192. }());
  1193. /***** unicode-base.js *****/
  1194. /*!
  1195. * XRegExp Unicode Base v1.0.0
  1196. * (c) 2008-2012 Steven Levithan <http://xregexp.com/>
  1197. * MIT License
  1198. * Uses Unicode 6.1 <http://unicode.org/>
  1199. */
  1200. /**
  1201. * Adds support for the `\p{L}` or `\p{Letter}` Unicode category. Addon packages for other Unicode
  1202. * categories, scripts, blocks, and properties are available separately. All Unicode tokens can be
  1203. * inverted using `\P{..}` or `\p{^..}`. Token names are case insensitive, and any spaces, hyphens,
  1204. * and underscores are ignored.
  1205. * @requires XRegExp
  1206. */
  1207. (function (XRegExp) {
  1208. "use strict";
  1209. var unicode = {};
  1210. /*--------------------------------------
  1211. * Private helper functions
  1212. *------------------------------------*/
  1213. // Generates a standardized token name (lowercase, with hyphens, spaces, and underscores removed)
  1214. function slug(name) {
  1215. return name.replace(/[- _]+/g, "").toLowerCase();
  1216. }
  1217. // Expands a list of Unicode code points and ranges to be usable in a regex character class
  1218. function expand(str) {
  1219. return str.replace(/\w{4}/g, "\\u$&");
  1220. }
  1221. // Adds leading zeros if shorter than four characters
  1222. function pad4(str) {
  1223. while (str.length < 4) {
  1224. str = "0" + str;
  1225. }
  1226. return str;
  1227. }
  1228. // Converts a hexadecimal number to decimal
  1229. function dec(hex) {
  1230. return parseInt(hex, 16);
  1231. }
  1232. // Converts a decimal number to hexadecimal
  1233. function hex(dec) {
  1234. return parseInt(dec, 10).toString(16);
  1235. }
  1236. // Inverts a list of Unicode code points and ranges
  1237. function invert(range) {
  1238. var output = [],
  1239. lastEnd = -1,
  1240. start;
  1241. XRegExp.forEach(range, /\\u(\w{4})(?:-\\u(\w{4}))?/, function (m) {
  1242. start = dec(m[1]);
  1243. if (start > (lastEnd + 1)) {
  1244. output.push("\\u" + pad4(hex(lastEnd + 1)));
  1245. if (start > (lastEnd + 2)) {
  1246. output.push("-\\u" + pad4(hex(start - 1)));
  1247. }
  1248. }
  1249. lastEnd = dec(m[2] || m[1]);
  1250. });
  1251. if (lastEnd < 0xFFFF) {
  1252. output.push("\\u" + pad4(hex(lastEnd + 1)));
  1253. if (lastEnd < 0xFFFE) {
  1254. output.push("-\\uFFFF");
  1255. }
  1256. }
  1257. return output.join("");
  1258. }
  1259. // Generates an inverted token on first use
  1260. function cacheInversion(item) {
  1261. return unicode["^" + item] || (unicode["^" + item] = invert(unicode[item]));
  1262. }
  1263. /*--------------------------------------
  1264. * Core functionality
  1265. *------------------------------------*/
  1266. XRegExp.install("extensibility");
  1267. /**
  1268. * Adds to the list of Unicode properties that XRegExp regexes can match via \p{..} or \P{..}.
  1269. * @memberOf XRegExp
  1270. * @param {Object} pack Named sets of Unicode code points and ranges.
  1271. * @param {Object} [aliases] Aliases for the primary token names.
  1272. * @example
  1273. *
  1274. * XRegExp.addUnicodePackage({
  1275. * XDigit: '0030-00390041-00460061-0066' // 0-9A-Fa-f
  1276. * }, {
  1277. * XDigit: 'Hexadecimal'
  1278. * });
  1279. */
  1280. XRegExp.addUnicodePackage = function (pack, aliases) {
  1281. var p;
  1282. if (!XRegExp.isInstalled("extensibility")) {
  1283. throw new Error("extensibility must be installed before adding Unicode packages");
  1284. }
  1285. if (pack) {
  1286. for (p in pack) {
  1287. if (pack.hasOwnProperty(p)) {
  1288. unicode[slug(p)] = expand(pack[p]);
  1289. }
  1290. }
  1291. }
  1292. if (aliases) {
  1293. for (p in aliases) {
  1294. if (aliases.hasOwnProperty(p)) {
  1295. unicode[slug(aliases[p])] = unicode[slug(p)];
  1296. }
  1297. }
  1298. }
  1299. };
  1300. /* Adds data for the Unicode `Letter` category. Addon packages include other categories, scripts,
  1301. * blocks, and properties.
  1302. */
  1303. XRegExp.addUnicodePackage({
  1304. L: "0041-005A0061-007A00AA00B500BA00C0-00D600D8-00F600F8-02C102C6-02D102E0-02E402EC02EE0370-037403760377037A-037D03860388-038A038C038E-03A103A3-03F503F7-0481048A-05270531-055605590561-058705D0-05EA05F0-05F20620-064A066E066F0671-06D306D506E506E606EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA07F407F507FA0800-0815081A082408280840-085808A008A2-08AC0904-0939093D09500958-09610971-09770979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10CF10CF20D05-0D0C0D0E-0D100D12-0D3A0D3D0D4E0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E460E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EC60EDC-0EDF0F000F40-0F470F49-0F6C0F88-0F8C1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10A0-10C510C710CD10D0-10FA10FC-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317D717DC1820-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541AA71B05-1B331B45-1B4B1B83-1BA01BAE1BAF1BBA-1BE51C00-1C231C4D-1C4F1C5A-1C7D1CE9-1CEC1CEE-1CF11CF51CF61D00-1DBF1E00-1F151F18-1F1D1F20-1F451F48-1F4D1F50-1F571F591F5B1F5D1F5F-1F7D1F80-1FB41FB6-1FBC1FBE1FC2-1FC41FC6-1FCC1FD0-1FD31FD6-1FDB1FE0-1FEC1FF2-1FF41FF6-1FFC2071207F2090-209C21022107210A-211321152119-211D212421262128212A-212D212F-2139213C-213F2145-2149214E218321842C00-2C2E2C30-2C5E2C60-2CE42CEB-2CEE2CF22CF32D00-2D252D272D2D2D30-2D672D6F2D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE2E2F300530063031-3035303B303C3041-3096309D-309F30A1-30FA30FC-30FF3105-312D3131-318E31A0-31BA31F0-31FF3400-4DB54E00-9FCCA000-A48CA4D0-A4FDA500-A60CA610-A61FA62AA62BA640-A66EA67F-A697A6A0-A6E5A717-A71FA722-A788A78B-A78EA790-A793A7A0-A7AAA7F8-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2A9CFAA00-AA28AA40-AA42AA44-AA4BAA60-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADB-AADDAAE0-AAEAAAF2-AAF4AB01-AB06AB09-AB0EAB11-AB16AB20-AB26AB28-AB2EABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA6DFA70-FAD9FB00-FB06FB13-FB17FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF21-FF3AFF41-FF5AFF66-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC"
  1305. }, {
  1306. L: "Letter"
  1307. });
  1308. /* Adds Unicode property syntax to XRegExp: \p{..}, \P{..}, \p{^..}
  1309. */
  1310. XRegExp.addToken(
  1311. /\\([pP]){(\^?)([^}]*)}/,
  1312. function (match, scope) {
  1313. var inv = (match[1] === "P" || match[2]) ? "^" : "",
  1314. item = slug(match[3]);
  1315. // The double negative \P{^..} is invalid
  1316. if (match[1] === "P" && match[2]) {
  1317. throw new SyntaxError("invalid double negation \\P{^");
  1318. }
  1319. if (!unicode.hasOwnProperty(item)) {
  1320. throw new SyntaxError("invalid or unknown Unicode property " + match[0]);
  1321. }
  1322. return scope === "class" ?
  1323. (inv ? cacheInversion(item) : unicode[item]) :
  1324. "[" + inv + unicode[item] + "]";
  1325. },
  1326. {scope: "all"}
  1327. );
  1328. }(XRegExp));
  1329. /***** unicode-categories.js *****/
  1330. /*!
  1331. * XRegExp Unicode Categories v1.2.0
  1332. * (c) 2010-2012 Steven Levithan <http://xregexp.com/>
  1333. * MIT License
  1334. * Uses Unicode 6.1 <http://unicode.org/>
  1335. */
  1336. /**
  1337. * Adds support for all Unicode categories (aka properties) E.g., `\p{Lu}` or
  1338. * `\p{Uppercase Letter}`. Token names are case insensitive, and any spaces, hyphens, and
  1339. * underscores are ignored.
  1340. * @requires XRegExp, XRegExp Unicode Base
  1341. */
  1342. (function (XRegExp) {
  1343. "use strict";
  1344. if (!XRegExp.addUnicodePackage) {
  1345. throw new ReferenceError("Unicode Base must be loaded before Unicode Categories");
  1346. }
  1347. XRegExp.install("extensibility");
  1348. XRegExp.addUnicodePackage({
  1349. //L: "", // Included in the Unicode Base addon
  1350. Ll: "0061-007A00B500DF-00F600F8-00FF01010103010501070109010B010D010F01110113011501170119011B011D011F01210123012501270129012B012D012F01310133013501370138013A013C013E014001420144014601480149014B014D014F01510153015501570159015B015D015F01610163016501670169016B016D016F0171017301750177017A017C017E-0180018301850188018C018D019201950199-019B019E01A101A301A501A801AA01AB01AD01B001B401B601B901BA01BD-01BF01C601C901CC01CE01D001D201D401D601D801DA01DC01DD01DF01E101E301E501E701E901EB01ED01EF01F001F301F501F901FB01FD01FF02010203020502070209020B020D020F02110213021502170219021B021D021F02210223022502270229022B022D022F02310233-0239023C023F0240024202470249024B024D024F-02930295-02AF037103730377037B-037D039003AC-03CE03D003D103D5-03D703D903DB03DD03DF03E103E303E503E703E903EB03ED03EF-03F303F503F803FB03FC0430-045F04610463046504670469046B046D046F04710473047504770479047B047D047F0481048B048D048F04910493049504970499049B049D049F04A104A304A504A704A904AB04AD04AF04B104B304B504B704B904BB04BD04BF04C204C404C604C804CA04CC04CE04CF04D104D304D504D704D904DB04DD04DF04E104E304E504E704E904EB04ED04EF04F104F304F504F704F904FB04FD04FF05010503050505070509050B050D050F05110513051505170519051B051D051F05210523052505270561-05871D00-1D2B1D6B-1D771D79-1D9A1E011E031E051E071E091E0B1E0D1E0F1E111E131E151E171E191E1B1E1D1E1F1E211E231E251E271E291E2B1E2D1E2F1E311E331E351E371E391E3B1E3D1E3F1E411E431E451E471E491E4B1E4D1E4F1E511E531E551E571E591E5B1E5D1E5F1E611E631E651E671E691E6B1E6D1E6F1E711E731E751E771E791E7B1E7D1E7F1E811E831E851E871E891E8B1E8D1E8F1E911E931E95-1E9D1E9F1EA11EA31EA51EA71EA91EAB1EAD1EAF1EB11EB31EB51EB71EB91EBB1EBD1EBF1EC11EC31EC51EC71EC91ECB1ECD1ECF1ED11ED31ED51ED71ED91EDB1EDD1EDF1EE11EE31EE51EE71EE91EEB1EED1EEF1EF11EF31EF51EF71EF91EFB1EFD1EFF-1F071F10-1F151F20-1F271F30-1F371F40-1F451F50-1F571F60-1F671F70-1F7D1F80-1F871F90-1F971FA0-1FA71FB0-1FB41FB61FB71FBE1FC2-1FC41FC61FC71FD0-1FD31FD61FD71FE0-1FE71FF2-1FF41FF61FF7210A210E210F2113212F21342139213C213D2146-2149214E21842C30-2C5E2C612C652C662C682C6A2C6C2C712C732C742C76-2C7B2C812C832C852C872C892C8B2C8D2C8F2C912C932C952C972C992C9B2C9D2C9F2CA12CA32CA52CA72CA92CAB2CAD2CAF2CB12CB32CB52CB72CB92CBB2CBD2CBF2CC12CC32CC52CC72CC92CCB2CCD2CCF2CD12CD32CD52CD72CD92CDB2CDD2CDF2CE12CE32CE42CEC2CEE2CF32D00-2D252D272D2DA641A643A645A647A649A64BA64DA64FA651A653A655A657A659A65BA65DA65FA661A663A665A667A669A66BA66DA681A683A685A687A689A68BA68DA68FA691A693A695A697A723A725A727A729A72BA72DA72F-A731A733A735A737A739A73BA73DA73FA741A743A745A747A749A74BA74DA74FA751A753A755A757A759A75BA75DA75FA761A763A765A767A769A76BA76DA76FA771-A778A77AA77CA77FA781A783A785A787A78CA78EA791A793A7A1A7A3A7A5A7A7A7A9A7FAFB00-FB06FB13-FB17FF41-FF5A",
  1351. Lu: "0041-005A00C0-00D600D8-00DE01000102010401060108010A010C010E01100112011401160118011A011C011E01200122012401260128012A012C012E01300132013401360139013B013D013F0141014301450147014A014C014E01500152015401560158015A015C015E01600162016401660168016A016C016E017001720174017601780179017B017D018101820184018601870189-018B018E-0191019301940196-0198019C019D019F01A001A201A401A601A701A901AC01AE01AF01B1-01B301B501B701B801BC01C401C701CA01CD01CF01D101D301D501D701D901DB01DE01E001E201E401E601E801EA01EC01EE01F101F401F6-01F801FA01FC01FE02000202020402060208020A020C020E02100212021402160218021A021C021E02200222022402260228022A022C022E02300232023A023B023D023E02410243-02460248024A024C024E03700372037603860388-038A038C038E038F0391-03A103A3-03AB03CF03D2-03D403D803DA03DC03DE03E003E203E403E603E803EA03EC03EE03F403F703F903FA03FD-042F04600462046404660468046A046C046E04700472047404760478047A047C047E0480048A048C048E04900492049404960498049A049C049E04A004A204A404A604A804AA04AC04AE04B004B204B404B604B804BA04BC04BE04C004C104C304C504C704C904CB04CD04D004D204D404D604D804DA04DC04DE04E004E204E404E604E804EA04EC04EE04F004F204F404F604F804FA04FC04FE05000502050405060508050A050C050E05100512051405160518051A051C051E05200522052405260531-055610A0-10C510C710CD1E001E021E041E061E081E0A1E0C1E0E1E101E121E141E161E181E1A1E1C1E1E1E201E221E241E261E281E2A1E2C1E2E1E301E321E341E361E381E3A1E3C1E3E1E401E421E441E461E481E4A1E4C1E4E1E501E521E541E561E581E5A1E5C1E5E1E601E621E641E661E681E6A1E6C1E6E1E701E721E741E761E781E7A1E7C1E7E1E801E821E841E861E881E8A1E8C1E8E1E901E921E941E9E1EA01EA21EA41EA61EA81EAA1EAC1EAE1EB01EB21EB41EB61EB81EBA1EBC1EBE1EC01EC21EC41EC61EC81ECA1ECC1ECE1ED01ED21ED41ED61ED81EDA1EDC1EDE1EE01EE21EE41EE61EE81EEA1EEC1EEE1EF01EF21EF41EF61EF81EFA1EFC1EFE1F08-1F0F1F18-1F1D1F28-1F2F1F38-1F3F1F48-1F4D1F591F5B1F5D1F5F1F68-1F6F1FB8-1FBB1FC8-1FCB1FD8-1FDB1FE8-1FEC1FF8-1FFB21022107210B-210D2110-211221152119-211D212421262128212A-212D2130-2133213E213F214521832C00-2C2E2C602C62-2C642C672C692C6B2C6D-2C702C722C752C7E-2C802C822C842C862C882C8A2C8C2C8E2C902C922C942C962C982C9A2C9C2C9E2CA02CA22CA42CA62CA82CAA2CAC2CAE2CB02CB22CB42CB62CB82CBA2CBC2CBE2CC02CC22CC42CC62CC82CCA2CCC2CCE2CD02CD22CD42CD62CD82CDA2CDC2CDE2CE02CE22CEB2CED2CF2A640A642A644A646A648A64AA64CA64EA650A652A654A656A658A65AA65CA65EA660A662A664A666A668A66AA66CA680A682A684A686A688A68AA68CA68EA690A692A694A696A722A724A726A728A72AA72CA72EA732A734A736A738A73AA73CA73EA740A742A744A746A748A74AA74CA74EA750A752A754A756A758A75AA75CA75EA760A762A764A766A768A76AA76CA76EA779A77BA77DA77EA780A782A784A786A78BA78DA790A792A7A0A7A2A7A4A7A6A7A8A7AAFF21-FF3A",
  1352. Lt: "01C501C801CB01F21F88-1F8F1F98-1F9F1FA8-1FAF1FBC1FCC1FFC",
  1353. Lm: "02B0-02C102C6-02D102E0-02E402EC02EE0374037A0559064006E506E607F407F507FA081A0824082809710E460EC610FC17D718431AA71C78-1C7D1D2C-1D6A1D781D9B-1DBF2071207F2090-209C2C7C2C7D2D6F2E2F30053031-3035303B309D309E30FC-30FEA015A4F8-A4FDA60CA67FA717-A71FA770A788A7F8A7F9A9CFAA70AADDAAF3AAF4FF70FF9EFF9F",
  1354. Lo: "00AA00BA01BB01C0-01C3029405D0-05EA05F0-05F20620-063F0641-064A066E066F0671-06D306D506EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA0800-08150840-085808A008A2-08AC0904-0939093D09500958-09610972-09770979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10CF10CF20D05-0D0C0D0E-0D100D12-0D3A0D3D0D4E0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E450E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EDC-0EDF0F000F40-0F470F49-0F6C0F88-0F8C1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10D0-10FA10FD-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317DC1820-18421844-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541B05-1B331B45-1B4B1B83-1BA01BAE1BAF1BBA-1BE51C00-1C231C4D-1C4F1C5A-1C771CE9-1CEC1CEE-1CF11CF51CF62135-21382D30-2D672D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE3006303C3041-3096309F30A1-30FA30FF3105-312D3131-318E31A0-31BA31F0-31FF3400-4DB54E00-9FCCA000-A014A016-A48CA4D0-A4F7A500-A60BA610-A61FA62AA62BA66EA6A0-A6E5A7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2AA00-AA28AA40-AA42AA44-AA4BAA60-AA6FAA71-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADBAADCAAE0-AAEAAAF2AB01-AB06AB09-AB0EAB11-AB16AB20-AB26AB28-AB2EABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA6DFA70-FAD9FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF66-FF6FFF71-FF9DFFA0-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC",
  1355. M: "0300-036F0483-04890591-05BD05BF05C105C205C405C505C70610-061A064B-065F067006D6-06DC06DF-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0859-085B08E4-08FE0900-0903093A-093C093E-094F0951-0957096209630981-098309BC09BE-09C409C709C809CB-09CD09D709E209E30A01-0A030A3C0A3E-0A420A470A480A4B-0A4D0A510A700A710A750A81-0A830ABC0ABE-0AC50AC7-0AC90ACB-0ACD0AE20AE30B01-0B030B3C0B3E-0B440B470B480B4B-0B4D0B560B570B620B630B820BBE-0BC20BC6-0BC80BCA-0BCD0BD70C01-0C030C3E-0C440C46-0C480C4A-0C4D0C550C560C620C630C820C830CBC0CBE-0CC40CC6-0CC80CCA-0CCD0CD50CD60CE20CE30D020D030D3E-0D440D46-0D480D4A-0D4D0D570D620D630D820D830DCA0DCF-0DD40DD60DD8-0DDF0DF20DF30E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F3E0F3F0F71-0F840F860F870F8D-0F970F99-0FBC0FC6102B-103E1056-1059105E-10601062-10641067-106D1071-10741082-108D108F109A-109D135D-135F1712-17141732-1734175217531772177317B4-17D317DD180B-180D18A91920-192B1930-193B19B0-19C019C819C91A17-1A1B1A55-1A5E1A60-1A7C1A7F1B00-1B041B34-1B441B6B-1B731B80-1B821BA1-1BAD1BE6-1BF31C24-1C371CD0-1CD21CD4-1CE81CED1CF2-1CF41DC0-1DE61DFC-1DFF20D0-20F02CEF-2CF12D7F2DE0-2DFF302A-302F3099309AA66F-A672A674-A67DA69FA6F0A6F1A802A806A80BA823-A827A880A881A8B4-A8C4A8E0-A8F1A926-A92DA947-A953A980-A983A9B3-A9C0AA29-AA36AA43AA4CAA4DAA7BAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1AAEB-AAEFAAF5AAF6ABE3-ABEAABECABEDFB1EFE00-FE0FFE20-FE26",
  1356. Mn: "0300-036F0483-04870591-05BD05BF05C105C205C405C505C70610-061A064B-065F067006D6-06DC06DF-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0859-085B08E4-08FE0900-0902093A093C0941-0948094D0951-095709620963098109BC09C1-09C409CD09E209E30A010A020A3C0A410A420A470A480A4B-0A4D0A510A700A710A750A810A820ABC0AC1-0AC50AC70AC80ACD0AE20AE30B010B3C0B3F0B41-0B440B4D0B560B620B630B820BC00BCD0C3E-0C400C46-0C480C4A-0C4D0C550C560C620C630CBC0CBF0CC60CCC0CCD0CE20CE30D41-0D440D4D0D620D630DCA0DD2-0DD40DD60E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F71-0F7E0F80-0F840F860F870F8D-0F970F99-0FBC0FC6102D-10301032-10371039103A103D103E10581059105E-10601071-1074108210851086108D109D135D-135F1712-17141732-1734175217531772177317B417B517B7-17BD17C617C9-17D317DD180B-180D18A91920-19221927192819321939-193B1A171A181A561A58-1A5E1A601A621A65-1A6C1A73-1A7C1A7F1B00-1B031B341B36-1B3A1B3C1B421B6B-1B731B801B811BA2-1BA51BA81BA91BAB1BE61BE81BE91BED1BEF-1BF11C2C-1C331C361C371CD0-1CD21CD4-1CE01CE2-1CE81CED1CF41DC0-1DE61DFC-1DFF20D0-20DC20E120E5-20F02CEF-2CF12D7F2DE0-2DFF302A-302D3099309AA66FA674-A67DA69FA6F0A6F1A802A806A80BA825A826A8C4A8E0-A8F1A926-A92DA947-A951A980-A982A9B3A9B6-A9B9A9BCAA29-AA2EAA31AA32AA35AA36AA43AA4CAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1AAECAAEDAAF6ABE5ABE8ABEDFB1EFE00-FE0FFE20-FE26",
  1357. Mc: "0903093B093E-09400949-094C094E094F0982098309BE-09C009C709C809CB09CC09D70A030A3E-0A400A830ABE-0AC00AC90ACB0ACC0B020B030B3E0B400B470B480B4B0B4C0B570BBE0BBF0BC10BC20BC6-0BC80BCA-0BCC0BD70C01-0C030C41-0C440C820C830CBE0CC0-0CC40CC70CC80CCA0CCB0CD50CD60D020D030D3E-0D400D46-0D480D4A-0D4C0D570D820D830DCF-0DD10DD8-0DDF0DF20DF30F3E0F3F0F7F102B102C10311038103B103C105610571062-10641067-106D108310841087-108C108F109A-109C17B617BE-17C517C717C81923-19261929-192B193019311933-193819B0-19C019C819C91A19-1A1B1A551A571A611A631A641A6D-1A721B041B351B3B1B3D-1B411B431B441B821BA11BA61BA71BAA1BAC1BAD1BE71BEA-1BEC1BEE1BF21BF31C24-1C2B1C341C351CE11CF21CF3302E302FA823A824A827A880A881A8B4-A8C3A952A953A983A9B4A9B5A9BAA9BBA9BD-A9C0AA2FAA30AA33AA34AA4DAA7BAAEBAAEEAAEFAAF5ABE3ABE4ABE6ABE7ABE9ABEAABEC",
  1358. Me: "0488048920DD-20E020E2-20E4A670-A672",
  1359. N: "0030-003900B200B300B900BC-00BE0660-066906F0-06F907C0-07C90966-096F09E6-09EF09F4-09F90A66-0A6F0AE6-0AEF0B66-0B6F0B72-0B770BE6-0BF20C66-0C6F0C78-0C7E0CE6-0CEF0D66-0D750E50-0E590ED0-0ED90F20-0F331040-10491090-10991369-137C16EE-16F017E0-17E917F0-17F91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C5920702074-20792080-20892150-21822185-21892460-249B24EA-24FF2776-27932CFD30073021-30293038-303A3192-31953220-32293248-324F3251-325F3280-328932B1-32BFA620-A629A6E6-A6EFA830-A835A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19",
  1360. Nd: "0030-00390660-066906F0-06F907C0-07C90966-096F09E6-09EF0A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BEF0C66-0C6F0CE6-0CEF0D66-0D6F0E50-0E590ED0-0ED90F20-0F291040-10491090-109917E0-17E91810-18191946-194F19D0-19D91A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C59A620-A629A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19",
  1361. Nl: "16EE-16F02160-21822185-218830073021-30293038-303AA6E6-A6EF",
  1362. No: "00B200B300B900BC-00BE09F4-09F90B72-0B770BF0-0BF20C78-0C7E0D70-0D750F2A-0F331369-137C17F0-17F919DA20702074-20792080-20892150-215F21892460-249B24EA-24FF2776-27932CFD3192-31953220-32293248-324F3251-325F3280-328932B1-32BFA830-A835",
  1363. P: "0021-00230025-002A002C-002F003A003B003F0040005B-005D005F007B007D00A100A700AB00B600B700BB00BF037E0387055A-055F0589058A05BE05C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E085E0964096509700AF00DF40E4F0E5A0E5B0F04-0F120F140F3A-0F3D0F850FD0-0FD40FD90FDA104A-104F10FB1360-13681400166D166E169B169C16EB-16ED1735173617D4-17D617D8-17DA1800-180A194419451A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601BFC-1BFF1C3B-1C3F1C7E1C7F1CC0-1CC71CD32010-20272030-20432045-20512053-205E207D207E208D208E2329232A2768-277527C527C627E6-27EF2983-299829D8-29DB29FC29FD2CF9-2CFC2CFE2CFF2D702E00-2E2E2E30-2E3B3001-30033008-30113014-301F3030303D30A030FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFAAF0AAF1ABEBFD3EFD3FFE10-FE19FE30-FE52FE54-FE61FE63FE68FE6AFE6BFF01-FF03FF05-FF0AFF0C-FF0FFF1AFF1BFF1FFF20FF3B-FF3DFF3FFF5BFF5DFF5F-FF65",
  1364. Pd: "002D058A05BE140018062010-20152E172E1A2E3A2E3B301C303030A0FE31FE32FE58FE63FF0D",
  1365. Ps: "0028005B007B0F3A0F3C169B201A201E2045207D208D23292768276A276C276E27702772277427C527E627E827EA27EC27EE2983298529872989298B298D298F299129932995299729D829DA29FC2E222E242E262E283008300A300C300E3010301430163018301A301DFD3EFE17FE35FE37FE39FE3BFE3DFE3FFE41FE43FE47FE59FE5BFE5DFF08FF3BFF5BFF5FFF62",
  1366. Pe: "0029005D007D0F3B0F3D169C2046207E208E232A2769276B276D276F27712773277527C627E727E927EB27ED27EF298429862988298A298C298E2990299229942996299829D929DB29FD2E232E252E272E293009300B300D300F3011301530173019301B301E301FFD3FFE18FE36FE38FE3AFE3CFE3EFE40FE42FE44FE48FE5AFE5CFE5EFF09FF3DFF5DFF60FF63",
  1367. Pi: "00AB2018201B201C201F20392E022E042E092E0C2E1C2E20",
  1368. Pf: "00BB2019201D203A2E032E052E0A2E0D2E1D2E21",
  1369. Pc: "005F203F20402054FE33FE34FE4D-FE4FFF3F",
  1370. Po: "0021-00230025-0027002A002C002E002F003A003B003F0040005C00A100A700B600B700BF037E0387055A-055F058905C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E085E0964096509700AF00DF40E4F0E5A0E5B0F04-0F120F140F850FD0-0FD40FD90FDA104A-104F10FB1360-1368166D166E16EB-16ED1735173617D4-17D617D8-17DA1800-18051807-180A194419451A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601BFC-1BFF1C3B-1C3F1C7E1C7F1CC0-1CC71CD3201620172020-20272030-2038203B-203E2041-20432047-205120532055-205E2CF9-2CFC2CFE2CFF2D702E002E012E06-2E082E0B2E0E-2E162E182E192E1B2E1E2E1F2E2A-2E2E2E30-2E393001-3003303D30FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFAAF0AAF1ABEBFE10-FE16FE19FE30FE45FE46FE49-FE4CFE50-FE52FE54-FE57FE5F-FE61FE68FE6AFE6BFF01-FF03FF05-FF07FF0AFF0CFF0EFF0FFF1AFF1BFF1FFF20FF3CFF61FF64FF65",
  1371. S: "0024002B003C-003E005E0060007C007E00A2-00A600A800A900AC00AE-00B100B400B800D700F702C2-02C502D2-02DF02E5-02EB02ED02EF-02FF03750384038503F60482058F0606-0608060B060E060F06DE06E906FD06FE07F609F209F309FA09FB0AF10B700BF3-0BFA0C7F0D790E3F0F01-0F030F130F15-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F1390-139917DB194019DE-19FF1B61-1B6A1B74-1B7C1FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE20442052207A-207C208A-208C20A0-20B9210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B2140-2144214A-214D214F2190-2328232B-23F32400-24262440-244A249C-24E92500-26FF2701-27672794-27C427C7-27E527F0-29822999-29D729DC-29FB29FE-2B4C2B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F309B309C319031913196-319F31C0-31E33200-321E322A-324732503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A700-A716A720A721A789A78AA828-A82BA836-A839AA77-AA79FB29FBB2-FBC1FDFCFDFDFE62FE64-FE66FE69FF04FF0BFF1C-FF1EFF3EFF40FF5CFF5EFFE0-FFE6FFE8-FFEEFFFCFFFD",
  1372. Sm: "002B003C-003E007C007E00AC00B100D700F703F60606-060820442052207A-207C208A-208C21182140-2144214B2190-2194219A219B21A021A321A621AE21CE21CF21D221D421F4-22FF2308-230B23202321237C239B-23B323DC-23E125B725C125F8-25FF266F27C0-27C427C7-27E527F0-27FF2900-29822999-29D729DC-29FB29FE-2AFF2B30-2B442B47-2B4CFB29FE62FE64-FE66FF0BFF1C-FF1EFF5CFF5EFFE2FFE9-FFEC",
  1373. Sc: "002400A2-00A5058F060B09F209F309FB0AF10BF90E3F17DB20A0-20B9A838FDFCFE69FF04FFE0FFE1FFE5FFE6",
  1374. Sk: "005E006000A800AF00B400B802C2-02C502D2-02DF02E5-02EB02ED02EF-02FF0375038403851FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE309B309CA700-A716A720A721A789A78AFBB2-FBC1FF3EFF40FFE3",
  1375. So: "00A600A900AE00B00482060E060F06DE06E906FD06FE07F609FA0B700BF3-0BF80BFA0C7F0D790F01-0F030F130F15-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F1390-1399194019DE-19FF1B61-1B6A1B74-1B7C210021012103-210621082109211421162117211E-2123212521272129212E213A213B214A214C214D214F2195-2199219C-219F21A121A221A421A521A7-21AD21AF-21CD21D021D121D321D5-21F32300-2307230C-231F2322-2328232B-237B237D-239A23B4-23DB23E2-23F32400-24262440-244A249C-24E92500-25B625B8-25C025C2-25F72600-266E2670-26FF2701-27672794-27BF2800-28FF2B00-2B2F2B452B462B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F319031913196-319F31C0-31E33200-321E322A-324732503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A828-A82BA836A837A839AA77-AA79FDFDFFE4FFE8FFEDFFEEFFFCFFFD",
  1376. Z: "002000A01680180E2000-200A20282029202F205F3000",
  1377. Zs: "002000A01680180E2000-200A202F205F3000",
  1378. Zl: "2028",
  1379. Zp: "2029",
  1380. C: "0000-001F007F-009F00AD03780379037F-0383038B038D03A20528-05300557055805600588058B-058E059005C8-05CF05EB-05EF05F5-0605061C061D06DD070E070F074B074C07B2-07BF07FB-07FF082E082F083F085C085D085F-089F08A108AD-08E308FF097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B78-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D3B0D3C0D450D490D4F-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EE0-0EFF0F480F6D-0F700F980FBD0FCD0FDB-0FFF10C610C8-10CC10CE10CF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B135C137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BF4-1BFB1C38-1C3A1C4A-1C4C1C80-1CBF1CC8-1CCF1CF7-1CFF1DE7-1DFB1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF200B-200F202A-202E2060-206F20722073208F209D-209F20BA-20CF20F1-20FF218A-218F23F4-23FF2427-243F244B-245F27002B4D-2B4F2B5A-2BFF2C2F2C5F2CF4-2CF82D262D28-2D2C2D2E2D2F2D68-2D6E2D71-2D7E2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E3C-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31BB-31BF31E4-31EF321F32FF4DB6-4DBF9FCD-9FFFA48D-A48FA4C7-A4CFA62C-A63FA698-A69EA6F8-A6FFA78FA794-A79FA7AB-A7F7A82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAF7-AB00AB07AB08AB0FAB10AB17-AB1FAB27AB2F-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-F8FFFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBC2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFD-FF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFFBFFFEFFFF",
  1381. Cc: "0000-001F007F-009F",
  1382. Cf: "00AD0600-060406DD070F200B-200F202A-202E2060-2064206A-206FFEFFFFF9-FFFB",
  1383. Co: "E000-F8FF",
  1384. Cs: "D800-DFFF",
  1385. Cn: "03780379037F-0383038B038D03A20528-05300557055805600588058B-058E059005C8-05CF05EB-05EF05F5-05FF0605061C061D070E074B074C07B2-07BF07FB-07FF082E082F083F085C085D085F-089F08A108AD-08E308FF097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B78-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D3B0D3C0D450D490D4F-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EE0-0EFF0F480F6D-0F700F980FBD0FCD0FDB-0FFF10C610C8-10CC10CE10CF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B135C137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BF4-1BFB1C38-1C3A1C4A-1C4C1C80-1CBF1CC8-1CCF1CF7-1CFF1DE7-1DFB1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF2065-206920722073208F209D-209F20BA-20CF20F1-20FF218A-218F23F4-23FF2427-243F244B-245F27002B4D-2B4F2B5A-2BFF2C2F2C5F2CF4-2CF82D262D28-2D2C2D2E2D2F2D68-2D6E2D71-2D7E2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E3C-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31BB-31BF31E4-31EF321F32FF4DB6-4DBF9FCD-9FFFA48D-A48FA4C7-A4CFA62C-A63FA698-A69EA6F8-A6FFA78FA794-A79FA7AB-A7F7A82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAF7-AB00AB07AB08AB0FAB10AB17-AB1FAB27AB2F-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-D7FFFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBC2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFDFEFEFF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFF8FFFEFFFF"
  1386. }, {
  1387. //L: "Letter", // Included in the Unicode Base addon
  1388. Ll: "Lowercase_Letter",
  1389. Lu: "Uppercase_Letter",
  1390. Lt: "Titlecase_Letter",
  1391. Lm: "Modifier_Letter",
  1392. Lo: "Other_Letter",
  1393. M: "Mark",
  1394. Mn: "Nonspacing_Mark",
  1395. Mc: "Spacing_Mark",
  1396. Me: "Enclosing_Mark",
  1397. N: "Number",
  1398. Nd: "Decimal_Number",
  1399. Nl: "Letter_Number",
  1400. No: "Other_Number",
  1401. P: "Punctuation",
  1402. Pd: "Dash_Punctuation",
  1403. Ps: "Open_Punctuation",
  1404. Pe: "Close_Punctuation",
  1405. Pi: "Initial_Punctuation",
  1406. Pf: "Final_Punctuation",
  1407. Pc: "Connector_Punctuation",
  1408. Po: "Other_Punctuation",
  1409. S: "Symbol",
  1410. Sm: "Math_Symbol",
  1411. Sc: "Currency_Symbol",
  1412. Sk: "Modifier_Symbol",
  1413. So: "Other_Symbol",
  1414. Z: "Separator",
  1415. Zs: "Space_Separator",
  1416. Zl: "Line_Separator",
  1417. Zp: "Paragraph_Separator",
  1418. C: "Other",
  1419. Cc: "Control",
  1420. Cf: "Format",
  1421. Co: "Private_Use",
  1422. Cs: "Surrogate",
  1423. Cn: "Unassigned"
  1424. });
  1425. }(XRegExp));
  1426. /***** unicode-scripts.js *****/
  1427. /*!
  1428. * XRegExp Unicode Scripts v1.2.0
  1429. * (c) 2010-2012 Steven Levithan <http://xregexp.com/>
  1430. * MIT License
  1431. * Uses Unicode 6.1 <http://unicode.org/>
  1432. */
  1433. /**
  1434. * Adds support for all Unicode scripts in the Basic Multilingual Plane (U+0000-U+FFFF).
  1435. * E.g., `\p{Latin}`. Token names are case insensitive, and any spaces, hyphens, and underscores
  1436. * are ignored.
  1437. * @requires XRegExp, XRegExp Unicode Base
  1438. */
  1439. (function (XRegExp) {
  1440. "use strict";
  1441. if (!XRegExp.addUnicodePackage) {
  1442. throw new ReferenceError("Unicode Base must be loaded before Unicode Scripts");
  1443. }
  1444. XRegExp.install("extensibility");
  1445. XRegExp.addUnicodePackage({
  1446. Arabic: "0600-06040606-060B060D-061A061E0620-063F0641-064A0656-065E066A-066F0671-06DC06DE-06FF0750-077F08A008A2-08AC08E4-08FEFB50-FBC1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFCFE70-FE74FE76-FEFC",
  1447. Armenian: "0531-05560559-055F0561-0587058A058FFB13-FB17",
  1448. Balinese: "1B00-1B4B1B50-1B7C",
  1449. Bamum: "A6A0-A6F7",
  1450. Batak: "1BC0-1BF31BFC-1BFF",
  1451. Bengali: "0981-09830985-098C098F09900993-09A809AA-09B009B209B6-09B909BC-09C409C709C809CB-09CE09D709DC09DD09DF-09E309E6-09FB",
  1452. Bopomofo: "02EA02EB3105-312D31A0-31BA",
  1453. Braille: "2800-28FF",
  1454. Buginese: "1A00-1A1B1A1E1A1F",
  1455. Buhid: "1740-1753",
  1456. Canadian_Aboriginal: "1400-167F18B0-18F5",
  1457. Cham: "AA00-AA36AA40-AA4DAA50-AA59AA5C-AA5F",
  1458. Cherokee: "13A0-13F4",
  1459. Common: "0000-0040005B-0060007B-00A900AB-00B900BB-00BF00D700F702B9-02DF02E5-02E902EC-02FF0374037E038503870589060C061B061F06400660-066906DD096409650E3F0FD5-0FD810FB16EB-16ED173517361802180318051CD31CE11CE9-1CEC1CEE-1CF31CF51CF62000-200B200E-2064206A-20702074-207E2080-208E20A0-20B92100-21252127-2129212C-21312133-214D214F-215F21892190-23F32400-24262440-244A2460-26FF2701-27FF2900-2B4C2B50-2B592E00-2E3B2FF0-2FFB3000-300430063008-30203030-3037303C-303F309B309C30A030FB30FC3190-319F31C0-31E33220-325F327F-32CF3358-33FF4DC0-4DFFA700-A721A788-A78AA830-A839FD3EFD3FFDFDFE10-FE19FE30-FE52FE54-FE66FE68-FE6BFEFFFF01-FF20FF3B-FF40FF5B-FF65FF70FF9EFF9FFFE0-FFE6FFE8-FFEEFFF9-FFFD",
  1460. Coptic: "03E2-03EF2C80-2CF32CF9-2CFF",
  1461. Cyrillic: "0400-04840487-05271D2B1D782DE0-2DFFA640-A697A69F",
  1462. Devanagari: "0900-09500953-09630966-09770979-097FA8E0-A8FB",
  1463. Ethiopic: "1200-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A135D-137C1380-13992D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDEAB01-AB06AB09-AB0EAB11-AB16AB20-AB26AB28-AB2E",
  1464. Georgian: "10A0-10C510C710CD10D0-10FA10FC-10FF2D00-2D252D272D2D",
  1465. Glagolitic: "2C00-2C2E2C30-2C5E",
  1466. Greek: "0370-03730375-0377037A-037D038403860388-038A038C038E-03A103A3-03E103F0-03FF1D26-1D2A1D5D-1D611D66-1D6A1DBF1F00-1F151F18-1F1D1F20-1F451F48-1F4D1F50-1F571F591F5B1F5D1F5F-1F7D1F80-1FB41FB6-1FC41FC6-1FD31FD6-1FDB1FDD-1FEF1FF2-1FF41FF6-1FFE2126",
  1467. Gujarati: "0A81-0A830A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABC-0AC50AC7-0AC90ACB-0ACD0AD00AE0-0AE30AE6-0AF1",
  1468. Gurmukhi: "0A01-0A030A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A3C0A3E-0A420A470A480A4B-0A4D0A510A59-0A5C0A5E0A66-0A75",
  1469. Han: "2E80-2E992E9B-2EF32F00-2FD5300530073021-30293038-303B3400-4DB54E00-9FCCF900-FA6DFA70-FAD9",
  1470. Hangul: "1100-11FF302E302F3131-318E3200-321E3260-327EA960-A97CAC00-D7A3D7B0-D7C6D7CB-D7FBFFA0-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC",
  1471. Hanunoo: "1720-1734",
  1472. Hebrew: "0591-05C705D0-05EA05F0-05F4FB1D-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FB4F",
  1473. Hiragana: "3041-3096309D-309F",
  1474. Inherited: "0300-036F04850486064B-0655065F0670095109521CD0-1CD21CD4-1CE01CE2-1CE81CED1CF41DC0-1DE61DFC-1DFF200C200D20D0-20F0302A-302D3099309AFE00-FE0FFE20-FE26",
  1475. Javanese: "A980-A9CDA9CF-A9D9A9DEA9DF",
  1476. Kannada: "0C820C830C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBC-0CC40CC6-0CC80CCA-0CCD0CD50CD60CDE0CE0-0CE30CE6-0CEF0CF10CF2",
  1477. Katakana: "30A1-30FA30FD-30FF31F0-31FF32D0-32FE3300-3357FF66-FF6FFF71-FF9D",
  1478. Kayah_Li: "A900-A92F",
  1479. Khmer: "1780-17DD17E0-17E917F0-17F919E0-19FF",
  1480. Lao: "0E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB90EBB-0EBD0EC0-0EC40EC60EC8-0ECD0ED0-0ED90EDC-0EDF",
  1481. Latin: "0041-005A0061-007A00AA00BA00C0-00D600D8-00F600F8-02B802E0-02E41D00-1D251D2C-1D5C1D62-1D651D6B-1D771D79-1DBE1E00-1EFF2071207F2090-209C212A212B2132214E2160-21882C60-2C7FA722-A787A78B-A78EA790-A793A7A0-A7AAA7F8-A7FFFB00-FB06FF21-FF3AFF41-FF5A",
  1482. Lepcha: "1C00-1C371C3B-1C491C4D-1C4F",
  1483. Limbu: "1900-191C1920-192B1930-193B19401944-194F",
  1484. Lisu: "A4D0-A4FF",
  1485. Malayalam: "0D020D030D05-0D0C0D0E-0D100D12-0D3A0D3D-0D440D46-0D480D4A-0D4E0D570D60-0D630D66-0D750D79-0D7F",
  1486. Mandaic: "0840-085B085E",
  1487. Meetei_Mayek: "AAE0-AAF6ABC0-ABEDABF0-ABF9",
  1488. Mongolian: "1800180118041806-180E1810-18191820-18771880-18AA",
  1489. Myanmar: "1000-109FAA60-AA7B",
  1490. New_Tai_Lue: "1980-19AB19B0-19C919D0-19DA19DE19DF",
  1491. Nko: "07C0-07FA",
  1492. Ogham: "1680-169C",
  1493. Ol_Chiki: "1C50-1C7F",
  1494. Oriya: "0B01-0B030B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3C-0B440B470B480B4B-0B4D0B560B570B5C0B5D0B5F-0B630B66-0B77",
  1495. Phags_Pa: "A840-A877",
  1496. Rejang: "A930-A953A95F",
  1497. Runic: "16A0-16EA16EE-16F0",
  1498. Samaritan: "0800-082D0830-083E",
  1499. Saurashtra: "A880-A8C4A8CE-A8D9",
  1500. Sinhala: "0D820D830D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60DCA0DCF-0DD40DD60DD8-0DDF0DF2-0DF4",
  1501. Sundanese: "1B80-1BBF1CC0-1CC7",
  1502. Syloti_Nagri: "A800-A82B",
  1503. Syriac: "0700-070D070F-074A074D-074F",
  1504. Tagalog: "1700-170C170E-1714",
  1505. Tagbanwa: "1760-176C176E-177017721773",
  1506. Tai_Le: "1950-196D1970-1974",
  1507. Tai_Tham: "1A20-1A5E1A60-1A7C1A7F-1A891A90-1A991AA0-1AAD",
  1508. Tai_Viet: "AA80-AAC2AADB-AADF",
  1509. Tamil: "0B820B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BBE-0BC20BC6-0BC80BCA-0BCD0BD00BD70BE6-0BFA",
  1510. Telugu: "0C01-0C030C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D-0C440C46-0C480C4A-0C4D0C550C560C580C590C60-0C630C66-0C6F0C78-0C7F",
  1511. Thaana: "0780-07B1",
  1512. Thai: "0E01-0E3A0E40-0E5B",
  1513. Tibetan: "0F00-0F470F49-0F6C0F71-0F970F99-0FBC0FBE-0FCC0FCE-0FD40FD90FDA",
  1514. Tifinagh: "2D30-2D672D6F2D702D7F",
  1515. Vai: "A500-A62B",
  1516. Yi: "A000-A48CA490-A4C6"
  1517. });
  1518. }(XRegExp));
  1519. /***** unicode-blocks.js *****/
  1520. /*!
  1521. * XRegExp Unicode Blocks v1.2.0
  1522. * (c) 2010-2012 Steven Levithan <http://xregexp.com/>
  1523. * MIT License
  1524. * Uses Unicode 6.1 <http://unicode.org/>
  1525. */
  1526. /**
  1527. * Adds support for all Unicode blocks in the Basic Multilingual Plane (U+0000-U+FFFF). Unicode
  1528. * blocks use the prefix "In". E.g., `\p{InBasicLatin}`. Token names are case insensitive, and any
  1529. * spaces, hyphens, and underscores are ignored.
  1530. * @requires XRegExp, XRegExp Unicode Base
  1531. */
  1532. (function (XRegExp) {
  1533. "use strict";
  1534. if (!XRegExp.addUnicodePackage) {
  1535. throw new ReferenceError("Unicode Base must be loaded before Unicode Blocks");
  1536. }
  1537. XRegExp.install("extensibility");
  1538. XRegExp.addUnicodePackage({
  1539. InBasic_Latin: "0000-007F",
  1540. InLatin_1_Supplement: "0080-00FF",
  1541. InLatin_Extended_A: "0100-017F",
  1542. InLatin_Extended_B: "0180-024F",
  1543. InIPA_Extensions: "0250-02AF",
  1544. InSpacing_Modifier_Letters: "02B0-02FF",
  1545. InCombining_Diacritical_Marks: "0300-036F",
  1546. InGreek_and_Coptic: "0370-03FF",
  1547. InCyrillic: "0400-04FF",
  1548. InCyrillic_Supplement: "0500-052F",
  1549. InArmenian: "0530-058F",
  1550. InHebrew: "0590-05FF",
  1551. InArabic: "0600-06FF",
  1552. InSyriac: "0700-074F",
  1553. InArabic_Supplement: "0750-077F",
  1554. InThaana: "0780-07BF",
  1555. InNKo: "07C0-07FF",
  1556. InSamaritan: "0800-083F",
  1557. InMandaic: "0840-085F",
  1558. InArabic_Extended_A: "08A0-08FF",
  1559. InDevanagari: "0900-097F",
  1560. InBengali: "0980-09FF",
  1561. InGurmukhi: "0A00-0A7F",
  1562. InGujarati: "0A80-0AFF",
  1563. InOriya: "0B00-0B7F",
  1564. InTamil: "0B80-0BFF",
  1565. InTelugu: "0C00-0C7F",
  1566. InKannada: "0C80-0CFF",
  1567. InMalayalam: "0D00-0D7F",
  1568. InSinhala: "0D80-0DFF",
  1569. InThai: "0E00-0E7F",
  1570. InLao: "0E80-0EFF",
  1571. InTibetan: "0F00-0FFF",
  1572. InMyanmar: "1000-109F",
  1573. InGeorgian: "10A0-10FF",
  1574. InHangul_Jamo: "1100-11FF",
  1575. InEthiopic: "1200-137F",
  1576. InEthiopic_Supplement: "1380-139F",
  1577. InCherokee: "13A0-13FF",
  1578. InUnified_Canadian_Aboriginal_Syllabics: "1400-167F",
  1579. InOgham: "1680-169F",
  1580. InRunic: "16A0-16FF",
  1581. InTagalog: "1700-171F",
  1582. InHanunoo: "1720-173F",
  1583. InBuhid: "1740-175F",
  1584. InTagbanwa: "1760-177F",
  1585. InKhmer: "1780-17FF",
  1586. InMongolian: "1800-18AF",
  1587. InUnified_Canadian_Aboriginal_Syllabics_Extended: "18B0-18FF",
  1588. InLimbu: "1900-194F",
  1589. InTai_Le: "1950-197F",
  1590. InNew_Tai_Lue: "1980-19DF",
  1591. InKhmer_Symbols: "19E0-19FF",
  1592. InBuginese: "1A00-1A1F",
  1593. InTai_Tham: "1A20-1AAF",
  1594. InBalinese: "1B00-1B7F",
  1595. InSundanese: "1B80-1BBF",
  1596. InBatak: "1BC0-1BFF",
  1597. InLepcha: "1C00-1C4F",
  1598. InOl_Chiki: "1C50-1C7F",
  1599. InSundanese_Supplement: "1CC0-1CCF",
  1600. InVedic_Extensions: "1CD0-1CFF",
  1601. InPhonetic_Extensions: "1D00-1D7F",
  1602. InPhonetic_Extensions_Supplement: "1D80-1DBF",
  1603. InCombining_Diacritical_Marks_Supplement: "1DC0-1DFF",
  1604. InLatin_Extended_Additional: "1E00-1EFF",
  1605. InGreek_Extended: "1F00-1FFF",
  1606. InGeneral_Punctuation: "2000-206F",
  1607. InSuperscripts_and_Subscripts: "2070-209F",
  1608. InCurrency_Symbols: "20A0-20CF",
  1609. InCombining_Diacritical_Marks_for_Symbols: "20D0-20FF",
  1610. InLetterlike_Symbols: "2100-214F",
  1611. InNumber_Forms: "2150-218F",
  1612. InArrows: "2190-21FF",
  1613. InMathematical_Operators: "2200-22FF",
  1614. InMiscellaneous_Technical: "2300-23FF",
  1615. InControl_Pictures: "2400-243F",
  1616. InOptical_Character_Recognition: "2440-245F",
  1617. InEnclosed_Alphanumerics: "2460-24FF",
  1618. InBox_Drawing: "2500-257F",
  1619. InBlock_Elements: "2580-259F",
  1620. InGeometric_Shapes: "25A0-25FF",
  1621. InMiscellaneous_Symbols: "2600-26FF",
  1622. InDingbats: "2700-27BF",
  1623. InMiscellaneous_Mathematical_Symbols_A: "27C0-27EF",
  1624. InSupplemental_Arrows_A: "27F0-27FF",
  1625. InBraille_Patterns: "2800-28FF",
  1626. InSupplemental_Arrows_B: "2900-297F",
  1627. InMiscellaneous_Mathematical_Symbols_B: "2980-29FF",
  1628. InSupplemental_Mathematical_Operators: "2A00-2AFF",
  1629. InMiscellaneous_Symbols_and_Arrows: "2B00-2BFF",
  1630. InGlagolitic: "2C00-2C5F",
  1631. InLatin_Extended_C: "2C60-2C7F",
  1632. InCoptic: "2C80-2CFF",
  1633. InGeorgian_Supplement: "2D00-2D2F",
  1634. InTifinagh: "2D30-2D7F",
  1635. InEthiopic_Extended: "2D80-2DDF",
  1636. InCyrillic_Extended_A: "2DE0-2DFF",
  1637. InSupplemental_Punctuation: "2E00-2E7F",
  1638. InCJK_Radicals_Supplement: "2E80-2EFF",
  1639. InKangxi_Radicals: "2F00-2FDF",
  1640. InIdeographic_Description_Characters: "2FF0-2FFF",
  1641. InCJK_Symbols_and_Punctuation: "3000-303F",
  1642. InHiragana: "3040-309F",
  1643. InKatakana: "30A0-30FF",
  1644. InBopomofo: "3100-312F",
  1645. InHangul_Compatibility_Jamo: "3130-318F",
  1646. InKanbun: "3190-319F",
  1647. InBopomofo_Extended: "31A0-31BF",
  1648. InCJK_Strokes: "31C0-31EF",
  1649. InKatakana_Phonetic_Extensions: "31F0-31FF",
  1650. InEnclosed_CJK_Letters_and_Months: "3200-32FF",
  1651. InCJK_Compatibility: "3300-33FF",
  1652. InCJK_Unified_Ideographs_Extension_A: "3400-4DBF",
  1653. InYijing_Hexagram_Symbols: "4DC0-4DFF",
  1654. InCJK_Unified_Ideographs: "4E00-9FFF",
  1655. InYi_Syllables: "A000-A48F",
  1656. InYi_Radicals: "A490-A4CF",
  1657. InLisu: "A4D0-A4FF",
  1658. InVai: "A500-A63F",
  1659. InCyrillic_Extended_B: "A640-A69F",
  1660. InBamum: "A6A0-A6FF",
  1661. InModifier_Tone_Letters: "A700-A71F",
  1662. InLatin_Extended_D: "A720-A7FF",
  1663. InSyloti_Nagri: "A800-A82F",
  1664. InCommon_Indic_Number_Forms: "A830-A83F",
  1665. InPhags_pa: "A840-A87F",
  1666. InSaurashtra: "A880-A8DF",
  1667. InDevanagari_Extended: "A8E0-A8FF",
  1668. InKayah_Li: "A900-A92F",
  1669. InRejang: "A930-A95F",
  1670. InHangul_Jamo_Extended_A: "A960-A97F",
  1671. InJavanese: "A980-A9DF",
  1672. InCham: "AA00-AA5F",
  1673. InMyanmar_Extended_A: "AA60-AA7F",
  1674. InTai_Viet: "AA80-AADF",
  1675. InMeetei_Mayek_Extensions: "AAE0-AAFF",
  1676. InEthiopic_Extended_A: "AB00-AB2F",
  1677. InMeetei_Mayek: "ABC0-ABFF",
  1678. InHangul_Syllables: "AC00-D7AF",
  1679. InHangul_Jamo_Extended_B: "D7B0-D7FF",
  1680. InHigh_Surrogates: "D800-DB7F",
  1681. InHigh_Private_Use_Surrogates: "DB80-DBFF",
  1682. InLow_Surrogates: "DC00-DFFF",
  1683. InPrivate_Use_Area: "E000-F8FF",
  1684. InCJK_Compatibility_Ideographs: "F900-FAFF",
  1685. InAlphabetic_Presentation_Forms: "FB00-FB4F",
  1686. InArabic_Presentation_Forms_A: "FB50-FDFF",
  1687. InVariation_Selectors: "FE00-FE0F",
  1688. InVertical_Forms: "FE10-FE1F",
  1689. InCombining_Half_Marks: "FE20-FE2F",
  1690. InCJK_Compatibility_Forms: "FE30-FE4F",
  1691. InSmall_Form_Variants: "FE50-FE6F",
  1692. InArabic_Presentation_Forms_B: "FE70-FEFF",
  1693. InHalfwidth_and_Fullwidth_Forms: "FF00-FFEF",
  1694. InSpecials: "FFF0-FFFF"
  1695. });
  1696. }(XRegExp));
  1697. /***** unicode-properties.js *****/
  1698. /*!
  1699. * XRegExp Unicode Properties v1.0.0
  1700. * (c) 2012 Steven Levithan <http://xregexp.com/>
  1701. * MIT License
  1702. * Uses Unicode 6.1 <http://unicode.org/>
  1703. */
  1704. /**
  1705. * Adds Unicode properties necessary to meet Level 1 Unicode support (detailed in UTS#18 RL1.2).
  1706. * Includes code points from the Basic Multilingual Plane (U+0000-U+FFFF) only. Token names are
  1707. * case insensitive, and any spaces, hyphens, and underscores are ignored.
  1708. * @requires XRegExp, XRegExp Unicode Base
  1709. */
  1710. (function (XRegExp) {
  1711. "use strict";
  1712. if (!XRegExp.addUnicodePackage) {
  1713. throw new ReferenceError("Unicode Base must be loaded before Unicode Properties");
  1714. }
  1715. XRegExp.install("extensibility");
  1716. XRegExp.addUnicodePackage({
  1717. Alphabetic: "0041-005A0061-007A00AA00B500BA00C0-00D600D8-00F600F8-02C102C6-02D102E0-02E402EC02EE03450370-037403760377037A-037D03860388-038A038C038E-03A103A3-03F503F7-0481048A-05270531-055605590561-058705B0-05BD05BF05C105C205C405C505C705D0-05EA05F0-05F20610-061A0620-06570659-065F066E-06D306D5-06DC06E1-06E806ED-06EF06FA-06FC06FF0710-073F074D-07B107CA-07EA07F407F507FA0800-0817081A-082C0840-085808A008A2-08AC08E4-08E908F0-08FE0900-093B093D-094C094E-09500955-09630971-09770979-097F0981-09830985-098C098F09900993-09A809AA-09B009B209B6-09B909BD-09C409C709C809CB09CC09CE09D709DC09DD09DF-09E309F009F10A01-0A030A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A3E-0A420A470A480A4B0A4C0A510A59-0A5C0A5E0A70-0A750A81-0A830A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD-0AC50AC7-0AC90ACB0ACC0AD00AE0-0AE30B01-0B030B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D-0B440B470B480B4B0B4C0B560B570B5C0B5D0B5F-0B630B710B820B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BBE-0BC20BC6-0BC80BCA-0BCC0BD00BD70C01-0C030C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D-0C440C46-0C480C4A-0C4C0C550C560C580C590C60-0C630C820C830C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD-0CC40CC6-0CC80CCA-0CCC0CD50CD60CDE0CE0-0CE30CF10CF20D020D030D05-0D0C0D0E-0D100D12-0D3A0D3D-0D440D46-0D480D4A-0D4C0D4E0D570D60-0D630D7A-0D7F0D820D830D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60DCF-0DD40DD60DD8-0DDF0DF20DF30E01-0E3A0E40-0E460E4D0E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB90EBB-0EBD0EC0-0EC40EC60ECD0EDC-0EDF0F000F40-0F470F49-0F6C0F71-0F810F88-0F970F99-0FBC1000-10361038103B-103F1050-10621065-1068106E-1086108E109C109D10A0-10C510C710CD10D0-10FA10FC-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A135F1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA16EE-16F01700-170C170E-17131720-17331740-17531760-176C176E-1770177217731780-17B317B6-17C817D717DC1820-18771880-18AA18B0-18F51900-191C1920-192B1930-19381950-196D1970-19741980-19AB19B0-19C91A00-1A1B1A20-1A5E1A61-1A741AA71B00-1B331B35-1B431B45-1B4B1B80-1BA91BAC-1BAF1BBA-1BE51BE7-1BF11C00-1C351C4D-1C4F1C5A-1C7D1CE9-1CEC1CEE-1CF31CF51CF61D00-1DBF1E00-1F151F18-1F1D1F20-1F451F48-1F4D1F50-1F571F591F5B1F5D1F5F-1F7D1F80-1FB41FB6-1FBC1FBE1FC2-1FC41FC6-1FCC1FD0-1FD31FD6-1FDB1FE0-1FEC1FF2-1FF41FF6-1FFC2071207F2090-209C21022107210A-211321152119-211D212421262128212A-212D212F-2139213C-213F2145-2149214E2160-218824B6-24E92C00-2C2E2C30-2C5E2C60-2CE42CEB-2CEE2CF22CF32D00-2D252D272D2D2D30-2D672D6F2D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE2DE0-2DFF2E2F3005-30073021-30293031-30353038-303C3041-3096309D-309F30A1-30FA30FC-30FF3105-312D3131-318E31A0-31BA31F0-31FF3400-4DB54E00-9FCCA000-A48CA4D0-A4FDA500-A60CA610-A61FA62AA62BA640-A66EA674-A67BA67F-A697A69F-A6EFA717-A71FA722-A788A78B-A78EA790-A793A7A0-A7AAA7F8-A801A803-A805A807-A80AA80C-A827A840-A873A880-A8C3A8F2-A8F7A8FBA90A-A92AA930-A952A960-A97CA980-A9B2A9B4-A9BFA9CFAA00-AA36AA40-AA4DAA60-AA76AA7AAA80-AABEAAC0AAC2AADB-AADDAAE0-AAEFAAF2-AAF5AB01-AB06AB09-AB0EAB11-AB16AB20-AB26AB28-AB2EABC0-ABEAAC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA6DFA70-FAD9FB00-FB06FB13-FB17FB1D-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF21-FF3AFF41-FF5AFF66-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC",
  1718. Uppercase: "0041-005A00C0-00D600D8-00DE01000102010401060108010A010C010E01100112011401160118011A011C011E01200122012401260128012A012C012E01300132013401360139013B013D013F0141014301450147014A014C014E01500152015401560158015A015C015E01600162016401660168016A016C016E017001720174017601780179017B017D018101820184018601870189-018B018E-0191019301940196-0198019C019D019F01A001A201A401A601A701A901AC01AE01AF01B1-01B301B501B701B801BC01C401C701CA01CD01CF01D101D301D501D701D901DB01DE01E001E201E401E601E801EA01EC01EE01F101F401F6-01F801FA01FC01FE02000202020402060208020A020C020E02100212021402160218021A021C021E02200222022402260228022A022C022E02300232023A023B023D023E02410243-02460248024A024C024E03700372037603860388-038A038C038E038F0391-03A103A3-03AB03CF03D2-03D403D803DA03DC03DE03E003E203E403E603E803EA03EC03EE03F403F703F903FA03FD-042F04600462046404660468046A046C046E04700472047404760478047A047C047E0480048A048C048E04900492049404960498049A049C049E04A004A204A404A604A804AA04AC04AE04B004B204B404B604B804BA04BC04BE04C004C104C304C504C704C904CB04CD04D004D204D404D604D804DA04DC04DE04E004E204E404E604E804EA04EC04EE04F004F204F404F604F804FA04FC04FE05000502050405060508050A050C050E05100512051405160518051A051C051E05200522052405260531-055610A0-10C510C710CD1E001E021E041E061E081E0A1E0C1E0E1E101E121E141E161E181E1A1E1C1E1E1E201E221E241E261E281E2A1E2C1E2E1E301E321E341E361E381E3A1E3C1E3E1E401E421E441E461E481E4A1E4C1E4E1E501E521E541E561E581E5A1E5C1E5E1E601E621E641E661E681E6A1E6C1E6E1E701E721E741E761E781E7A1E7C1E7E1E801E821E841E861E881E8A1E8C1E8E1E901E921E941E9E1EA01EA21EA41EA61EA81EAA1EAC1EAE1EB01EB21EB41EB61EB81EBA1EBC1EBE1EC01EC21EC41EC61EC81ECA1ECC1ECE1ED01ED21ED41ED61ED81EDA1EDC1EDE1EE01EE21EE41EE61EE81EEA1EEC1EEE1EF01EF21EF41EF61EF81EFA1EFC1EFE1F08-1F0F1F18-1F1D1F28-1F2F1F38-1F3F1F48-1F4D1F591F5B1F5D1F5F1F68-1F6F1FB8-1FBB1FC8-1FCB1FD8-1FDB1FE8-1FEC1FF8-1FFB21022107210B-210D2110-211221152119-211D212421262128212A-212D2130-2133213E213F21452160-216F218324B6-24CF2C00-2C2E2C602C62-2C642C672C692C6B2C6D-2C702C722C752C7E-2C802C822C842C862C882C8A2C8C2C8E2C902C922C942C962C982C9A2C9C2C9E2CA02CA22CA42CA62CA82CAA2CAC2CAE2CB02CB22CB42CB62CB82CBA2CBC2CBE2CC02CC22CC42CC62CC82CCA2CCC2CCE2CD02CD22CD42CD62CD82CDA2CDC2CDE2CE02CE22CEB2CED2CF2A640A642A644A646A648A64AA64CA64EA650A652A654A656A658A65AA65CA65EA660A662A664A666A668A66AA66CA680A682A684A686A688A68AA68CA68EA690A692A694A696A722A724A726A728A72AA72CA72EA732A734A736A738A73AA73CA73EA740A742A744A746A748A74AA74CA74EA750A752A754A756A758A75AA75CA75EA760A762A764A766A768A76AA76CA76EA779A77BA77DA77EA780A782A784A786A78BA78DA790A792A7A0A7A2A7A4A7A6A7A8A7AAFF21-FF3A",
  1719. Lowercase: "0061-007A00AA00B500BA00DF-00F600F8-00FF01010103010501070109010B010D010F01110113011501170119011B011D011F01210123012501270129012B012D012F01310133013501370138013A013C013E014001420144014601480149014B014D014F01510153015501570159015B015D015F01610163016501670169016B016D016F0171017301750177017A017C017E-0180018301850188018C018D019201950199-019B019E01A101A301A501A801AA01AB01AD01B001B401B601B901BA01BD-01BF01C601C901CC01CE01D001D201D401D601D801DA01DC01DD01DF01E101E301E501E701E901EB01ED01EF01F001F301F501F901FB01FD01FF02010203020502070209020B020D020F02110213021502170219021B021D021F02210223022502270229022B022D022F02310233-0239023C023F0240024202470249024B024D024F-02930295-02B802C002C102E0-02E40345037103730377037A-037D039003AC-03CE03D003D103D5-03D703D903DB03DD03DF03E103E303E503E703E903EB03ED03EF-03F303F503F803FB03FC0430-045F04610463046504670469046B046D046F04710473047504770479047B047D047F0481048B048D048F04910493049504970499049B049D049F04A104A304A504A704A904AB04AD04AF04B104B304B504B704B904BB04BD04BF04C204C404C604C804CA04CC04CE04CF04D104D304D504D704D904DB04DD04DF04E104E304E504E704E904EB04ED04EF04F104F304F504F704F904FB04FD04FF05010503050505070509050B050D050F05110513051505170519051B051D051F05210523052505270561-05871D00-1DBF1E011E031E051E071E091E0B1E0D1E0F1E111E131E151E171E191E1B1E1D1E1F1E211E231E251E271E291E2B1E2D1E2F1E311E331E351E371E391E3B1E3D1E3F1E411E431E451E471E491E4B1E4D1E4F1E511E531E551E571E591E5B1E5D1E5F1E611E631E651E671E691E6B1E6D1E6F1E711E731E751E771E791E7B1E7D1E7F1E811E831E851E871E891E8B1E8D1E8F1E911E931E95-1E9D1E9F1EA11EA31EA51EA71EA91EAB1EAD1EAF1EB11EB31EB51EB71EB91EBB1EBD1EBF1EC11EC31EC51EC71EC91ECB1ECD1ECF1ED11ED31ED51ED71ED91EDB1EDD1EDF1EE11EE31EE51EE71EE91EEB1EED1EEF1EF11EF31EF51EF71EF91EFB1EFD1EFF-1F071F10-1F151F20-1F271F30-1F371F40-1F451F50-1F571F60-1F671F70-1F7D1F80-1F871F90-1F971FA0-1FA71FB0-1FB41FB61FB71FBE1FC2-1FC41FC61FC71FD0-1FD31FD61FD71FE0-1FE71FF2-1FF41FF61FF72071207F2090-209C210A210E210F2113212F21342139213C213D2146-2149214E2170-217F218424D0-24E92C30-2C5E2C612C652C662C682C6A2C6C2C712C732C742C76-2C7D2C812C832C852C872C892C8B2C8D2C8F2C912C932C952C972C992C9B2C9D2C9F2CA12CA32CA52CA72CA92CAB2CAD2CAF2CB12CB32CB52CB72CB92CBB2CBD2CBF2CC12CC32CC52CC72CC92CCB2CCD2CCF2CD12CD32CD52CD72CD92CDB2CDD2CDF2CE12CE32CE42CEC2CEE2CF32D00-2D252D272D2DA641A643A645A647A649A64BA64DA64FA651A653A655A657A659A65BA65DA65FA661A663A665A667A669A66BA66DA681A683A685A687A689A68BA68DA68FA691A693A695A697A723A725A727A729A72BA72DA72F-A731A733A735A737A739A73BA73DA73FA741A743A745A747A749A74BA74DA74FA751A753A755A757A759A75BA75DA75FA761A763A765A767A769A76BA76DA76F-A778A77AA77CA77FA781A783A785A787A78CA78EA791A793A7A1A7A3A7A5A7A7A7A9A7F8-A7FAFB00-FB06FB13-FB17FF41-FF5A",
  1720. White_Space: "0009-000D0020008500A01680180E2000-200A20282029202F205F3000",
  1721. Noncharacter_Code_Point: "FDD0-FDEFFFFEFFFF",
  1722. Default_Ignorable_Code_Point: "00AD034F115F116017B417B5180B-180D200B-200F202A-202E2060-206F3164FE00-FE0FFEFFFFA0FFF0-FFF8",
  1723. // \p{Any} matches a code unit. To match any code point via surrogate pairs, use (?:[\0-\uD7FF\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF])
  1724. Any: "0000-FFFF", // \p{^Any} compiles to [^\u0000-\uFFFF]; [\p{^Any}] to []
  1725. Ascii: "0000-007F",
  1726. // \p{Assigned} is equivalent to \p{^Cn}
  1727. //Assigned: XRegExp("[\\p{^Cn}]").source.replace(/[[\]]|\\u/g, "") // Negation inside a character class triggers inversion
  1728. Assigned: "0000-0377037A-037E0384-038A038C038E-03A103A3-05270531-05560559-055F0561-05870589058A058F0591-05C705D0-05EA05F0-05F40600-06040606-061B061E-070D070F-074A074D-07B107C0-07FA0800-082D0830-083E0840-085B085E08A008A2-08AC08E4-08FE0900-09770979-097F0981-09830985-098C098F09900993-09A809AA-09B009B209B6-09B909BC-09C409C709C809CB-09CE09D709DC09DD09DF-09E309E6-09FB0A01-0A030A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A3C0A3E-0A420A470A480A4B-0A4D0A510A59-0A5C0A5E0A66-0A750A81-0A830A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABC-0AC50AC7-0AC90ACB-0ACD0AD00AE0-0AE30AE6-0AF10B01-0B030B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3C-0B440B470B480B4B-0B4D0B560B570B5C0B5D0B5F-0B630B66-0B770B820B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BBE-0BC20BC6-0BC80BCA-0BCD0BD00BD70BE6-0BFA0C01-0C030C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D-0C440C46-0C480C4A-0C4D0C550C560C580C590C60-0C630C66-0C6F0C78-0C7F0C820C830C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBC-0CC40CC6-0CC80CCA-0CCD0CD50CD60CDE0CE0-0CE30CE6-0CEF0CF10CF20D020D030D05-0D0C0D0E-0D100D12-0D3A0D3D-0D440D46-0D480D4A-0D4E0D570D60-0D630D66-0D750D79-0D7F0D820D830D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60DCA0DCF-0DD40DD60DD8-0DDF0DF2-0DF40E01-0E3A0E3F-0E5B0E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB90EBB-0EBD0EC0-0EC40EC60EC8-0ECD0ED0-0ED90EDC-0EDF0F00-0F470F49-0F6C0F71-0F970F99-0FBC0FBE-0FCC0FCE-0FDA1000-10C510C710CD10D0-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A135D-137C1380-139913A0-13F41400-169C16A0-16F01700-170C170E-17141720-17361740-17531760-176C176E-1770177217731780-17DD17E0-17E917F0-17F91800-180E1810-18191820-18771880-18AA18B0-18F51900-191C1920-192B1930-193B19401944-196D1970-19741980-19AB19B0-19C919D0-19DA19DE-1A1B1A1E-1A5E1A60-1A7C1A7F-1A891A90-1A991AA0-1AAD1B00-1B4B1B50-1B7C1B80-1BF31BFC-1C371C3B-1C491C4D-1C7F1CC0-1CC71CD0-1CF61D00-1DE61DFC-1F151F18-1F1D1F20-1F451F48-1F4D1F50-1F571F591F5B1F5D1F5F-1F7D1F80-1FB41FB6-1FC41FC6-1FD31FD6-1FDB1FDD-1FEF1FF2-1FF41FF6-1FFE2000-2064206A-20712074-208E2090-209C20A0-20B920D0-20F02100-21892190-23F32400-24262440-244A2460-26FF2701-2B4C2B50-2B592C00-2C2E2C30-2C5E2C60-2CF32CF9-2D252D272D2D2D30-2D672D6F2D702D7F-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE2DE0-2E3B2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB3000-303F3041-30963099-30FF3105-312D3131-318E3190-31BA31C0-31E331F0-321E3220-32FE3300-4DB54DC0-9FCCA000-A48CA490-A4C6A4D0-A62BA640-A697A69F-A6F7A700-A78EA790-A793A7A0-A7AAA7F8-A82BA830-A839A840-A877A880-A8C4A8CE-A8D9A8E0-A8FBA900-A953A95F-A97CA980-A9CDA9CF-A9D9A9DEA9DFAA00-AA36AA40-AA4DAA50-AA59AA5C-AA7BAA80-AAC2AADB-AAF6AB01-AB06AB09-AB0EAB11-AB16AB20-AB26AB28-AB2EABC0-ABEDABF0-ABF9AC00-D7A3D7B0-D7C6D7CB-D7FBD800-FA6DFA70-FAD9FB00-FB06FB13-FB17FB1D-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBC1FBD3-FD3FFD50-FD8FFD92-FDC7FDF0-FDFDFE00-FE19FE20-FE26FE30-FE52FE54-FE66FE68-FE6BFE70-FE74FE76-FEFCFEFFFF01-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDCFFE0-FFE6FFE8-FFEEFFF9-FFFD"
  1729. });
  1730. }(XRegExp));
  1731. /***** matchrecursive.js *****/
  1732. /*!
  1733. * XRegExp.matchRecursive v0.2.0
  1734. * (c) 2009-2012 Steven Levithan <http://xregexp.com/>
  1735. * MIT License
  1736. */
  1737. (function (XRegExp) {
  1738. "use strict";
  1739. /**
  1740. * Returns a match detail object composed of the provided values.
  1741. * @private
  1742. */
  1743. function row(value, name, start, end) {
  1744. return {value:value, name:name, start:start, end:end};
  1745. }
  1746. /**
  1747. * Returns an array of match strings between outermost left and right delimiters, or an array of
  1748. * objects with detailed match parts and position data. An error is thrown if delimiters are
  1749. * unbalanced within the data.
  1750. * @memberOf XRegExp
  1751. * @param {String} str String to search.
  1752. * @param {String} left Left delimiter as an XRegExp pattern.
  1753. * @param {String} right Right delimiter as an XRegExp pattern.
  1754. * @param {String} [flags] Flags for the left and right delimiters. Use any of: `gimnsxy`.
  1755. * @param {Object} [options] Lets you specify `valueNames` and `escapeChar` options.
  1756. * @returns {Array} Array of matches, or an empty array.
  1757. * @example
  1758. *
  1759. * // Basic usage
  1760. * var str = '(t((e))s)t()(ing)';
  1761. * XRegExp.matchRecursive(str, '\\(', '\\)', 'g');
  1762. * // -> ['t((e))s', '', 'ing']
  1763. *
  1764. * // Extended information mode with valueNames
  1765. * str = 'Here is <div> <div>an</div></div> example';
  1766. * XRegExp.matchRecursive(str, '<div\\s*>', '</div>', 'gi', {
  1767. * valueNames: ['between', 'left', 'match', 'right']
  1768. * });
  1769. * // -> [
  1770. * // {name: 'between', value: 'Here is ', start: 0, end: 8},
  1771. * // {name: 'left', value: '<div>', start: 8, end: 13},
  1772. * // {name: 'match', value: ' <div>an</div>', start: 13, end: 27},
  1773. * // {name: 'right', value: '</div>', start: 27, end: 33},
  1774. * // {name: 'between', value: ' example', start: 33, end: 41}
  1775. * // ]
  1776. *
  1777. * // Omitting unneeded parts with null valueNames, and using escapeChar
  1778. * str = '...{1}\\{{function(x,y){return y+x;}}';
  1779. * XRegExp.matchRecursive(str, '{', '}', 'g', {
  1780. * valueNames: ['literal', null, 'value', null],
  1781. * escapeChar: '\\'
  1782. * });
  1783. * // -> [
  1784. * // {name: 'literal', value: '...', start: 0, end: 3},
  1785. * // {name: 'value', value: '1', start: 4, end: 5},
  1786. * // {name: 'literal', value: '\\{', start: 6, end: 8},
  1787. * // {name: 'value', value: 'function(x,y){return y+x;}', start: 9, end: 35}
  1788. * // ]
  1789. *
  1790. * // Sticky mode via flag y
  1791. * str = '<1><<<2>>><3>4<5>';
  1792. * XRegExp.matchRecursive(str, '<', '>', 'gy');
  1793. * // -> ['1', '<<2>>', '3']
  1794. */
  1795. XRegExp.matchRecursive = function (str, left, right, flags, options) {
  1796. flags = flags || "";
  1797. options = options || {};
  1798. var global = flags.indexOf("g") > -1,
  1799. sticky = flags.indexOf("y") > -1,
  1800. basicFlags = flags.replace(/y/g, ""), // Flag y controlled internally
  1801. escapeChar = options.escapeChar,
  1802. vN = options.valueNames,
  1803. output = [],
  1804. openTokens = 0,
  1805. delimStart = 0,
  1806. delimEnd = 0,
  1807. lastOuterEnd = 0,
  1808. outerStart,
  1809. innerStart,
  1810. leftMatch,
  1811. rightMatch,
  1812. esc;
  1813. left = XRegExp(left, basicFlags);
  1814. right = XRegExp(right, basicFlags);
  1815. if (escapeChar) {
  1816. if (escapeChar.length > 1) {
  1817. throw new SyntaxError("can't use more than one escape character");
  1818. }
  1819. escapeChar = XRegExp.escape(escapeChar);
  1820. // Using XRegExp.union safely rewrites backreferences in `left` and `right`
  1821. esc = new RegExp(
  1822. "(?:" + escapeChar + "[\\S\\s]|(?:(?!" + XRegExp.union([left, right]).source + ")[^" + escapeChar + "])+)+",
  1823. flags.replace(/[^im]+/g, "") // Flags gy not needed here; flags nsx handled by XRegExp
  1824. );
  1825. }
  1826. while (true) {
  1827. // If using an escape character, advance to the delimiter's next starting position,
  1828. // skipping any escaped characters in between
  1829. if (escapeChar) {
  1830. delimEnd += (XRegExp.exec(str, esc, delimEnd, "sticky") || [""])[0].length;
  1831. }
  1832. leftMatch = XRegExp.exec(str, left, delimEnd);
  1833. rightMatch = XRegExp.exec(str, right, delimEnd);
  1834. // Keep the leftmost match only
  1835. if (leftMatch && rightMatch) {
  1836. if (leftMatch.index <= rightMatch.index) {
  1837. rightMatch = null;
  1838. } else {
  1839. leftMatch = null;
  1840. }
  1841. }
  1842. /* Paths (LM:leftMatch, RM:rightMatch, OT:openTokens):
  1843. LM | RM | OT | Result
  1844. 1 | 0 | 1 | loop
  1845. 1 | 0 | 0 | loop
  1846. 0 | 1 | 1 | loop
  1847. 0 | 1 | 0 | throw
  1848. 0 | 0 | 1 | throw
  1849. 0 | 0 | 0 | break
  1850. * Doesn't include the sticky mode special case
  1851. * Loop ends after the first completed match if `!global` */
  1852. if (leftMatch || rightMatch) {
  1853. delimStart = (leftMatch || rightMatch).index;
  1854. delimEnd = delimStart + (leftMatch || rightMatch)[0].length;
  1855. } else if (!openTokens) {
  1856. break;
  1857. }
  1858. if (sticky && !openTokens && delimStart > lastOuterEnd) {
  1859. break;
  1860. }
  1861. if (leftMatch) {
  1862. if (!openTokens) {
  1863. outerStart = delimStart;
  1864. innerStart = delimEnd;
  1865. }
  1866. ++openTokens;
  1867. } else if (rightMatch && openTokens) {
  1868. if (!--openTokens) {
  1869. if (vN) {
  1870. if (vN[0] && outerStart > lastOuterEnd) {
  1871. output.push(row(vN[0], str.slice(lastOuterEnd, outerStart), lastOuterEnd, outerStart));
  1872. }
  1873. if (vN[1]) {
  1874. output.push(row(vN[1], str.slice(outerStart, innerStart), outerStart, innerStart));
  1875. }
  1876. if (vN[2]) {
  1877. output.push(row(vN[2], str.slice(innerStart, delimStart), innerStart, delimStart));
  1878. }
  1879. if (vN[3]) {
  1880. output.push(row(vN[3], str.slice(delimStart, delimEnd), delimStart, delimEnd));
  1881. }
  1882. } else {
  1883. output.push(str.slice(innerStart, delimStart));
  1884. }
  1885. lastOuterEnd = delimEnd;
  1886. if (!global) {
  1887. break;
  1888. }
  1889. }
  1890. } else {
  1891. throw new Error("string contains unbalanced delimiters");
  1892. }
  1893. // If the delimiter matched an empty string, avoid an infinite loop
  1894. if (delimStart === delimEnd) {
  1895. ++delimEnd;
  1896. }
  1897. }
  1898. if (global && !sticky && vN && vN[0] && str.length > lastOuterEnd) {
  1899. output.push(row(vN[0], str.slice(lastOuterEnd), lastOuterEnd, str.length));
  1900. }
  1901. return output;
  1902. };
  1903. }(XRegExp));
  1904. /***** build.js *****/
  1905. /*!
  1906. * XRegExp.build v0.1.0
  1907. * (c) 2012 Steven Levithan <http://xregexp.com/>
  1908. * MIT License
  1909. * Inspired by RegExp.create by Lea Verou <http://lea.verou.me/>
  1910. */
  1911. (function (XRegExp) {
  1912. "use strict";
  1913. var subparts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*]/g,
  1914. parts = XRegExp.union([/\({{([\w$]+)}}\)|{{([\w$]+)}}/, subparts], "g");
  1915. /**
  1916. * Strips a leading `^` and trailing unescaped `$`, if both are present.
  1917. * @private
  1918. * @param {String} pattern Pattern to process.
  1919. * @returns {String} Pattern with edge anchors removed.
  1920. */
  1921. function deanchor(pattern) {
  1922. var startAnchor = /^(?:\(\?:\))?\^/, // Leading `^` or `(?:)^` (handles /x cruft)
  1923. endAnchor = /\$(?:\(\?:\))?$/; // Trailing `$` or `$(?:)` (handles /x cruft)
  1924. if (endAnchor.test(pattern.replace(/\\[\s\S]/g, ""))) { // Ensure trailing `$` isn't escaped
  1925. return pattern.replace(startAnchor, "").replace(endAnchor, "");
  1926. }
  1927. return pattern;
  1928. }
  1929. /**
  1930. * Converts the provided value to an XRegExp.
  1931. * @private
  1932. * @param {String|RegExp} value Value to convert.
  1933. * @returns {RegExp} XRegExp object with XRegExp syntax applied.
  1934. */
  1935. function asXRegExp(value) {
  1936. return XRegExp.isRegExp(value) ?
  1937. (value.xregexp && !value.xregexp.isNative ? value : XRegExp(value.source)) :
  1938. XRegExp(value);
  1939. }
  1940. /**
  1941. * Builds regexes using named subpatterns, for readability and pattern reuse. Backreferences in the
  1942. * outer pattern and provided subpatterns are automatically renumbered to work correctly. Native
  1943. * flags used by provided subpatterns are ignored in favor of the `flags` argument.
  1944. * @memberOf XRegExp
  1945. * @param {String} pattern XRegExp pattern using `{{name}}` for embedded subpatterns. Allows
  1946. * `({{name}})` as shorthand for `(?<name>{{name}})`. Patterns cannot be embedded within
  1947. * character classes.
  1948. * @param {Object} subs Lookup object for named subpatterns. Values can be strings or regexes. A
  1949. * leading `^` and trailing unescaped `$` are stripped from subpatterns, if both are present.
  1950. * @param {String} [flags] Any combination of XRegExp flags.
  1951. * @returns {RegExp} Regex with interpolated subpatterns.
  1952. * @example
  1953. *
  1954. * var time = XRegExp.build('(?x)^ {{hours}} ({{minutes}}) $', {
  1955. * hours: XRegExp.build('{{h12}} : | {{h24}}', {
  1956. * h12: /1[0-2]|0?[1-9]/,
  1957. * h24: /2[0-3]|[01][0-9]/
  1958. * }, 'x'),
  1959. * minutes: /^[0-5][0-9]$/
  1960. * });
  1961. * time.test('10:59'); // -> true
  1962. * XRegExp.exec('10:59', time).minutes; // -> '59'
  1963. */
  1964. XRegExp.build = function (pattern, subs, flags) {
  1965. var inlineFlags = /^\(\?([\w$]+)\)/.exec(pattern),
  1966. data = {},
  1967. numCaps = 0, // Caps is short for captures
  1968. numPriorCaps,
  1969. numOuterCaps = 0,
  1970. outerCapsMap = [0],
  1971. outerCapNames,
  1972. sub,
  1973. p;
  1974. // Add flags within a leading mode modifier to the overall pattern's flags
  1975. if (inlineFlags) {
  1976. flags = flags || "";
  1977. inlineFlags[1].replace(/./g, function (flag) {
  1978. flags += (flags.indexOf(flag) > -1 ? "" : flag); // Don't add duplicates
  1979. });
  1980. }
  1981. for (p in subs) {
  1982. if (subs.hasOwnProperty(p)) {
  1983. // Passing to XRegExp enables entended syntax for subpatterns provided as strings
  1984. // and ensures independent validity, lest an unescaped `(`, `)`, `[`, or trailing
  1985. // `\` breaks the `(?:)` wrapper. For subpatterns provided as regexes, it dies on
  1986. // octals and adds the `xregexp` property, for simplicity
  1987. sub = asXRegExp(subs[p]);
  1988. // Deanchoring allows embedding independently useful anchored regexes. If you
  1989. // really need to keep your anchors, double them (i.e., `^^...$$`)
  1990. data[p] = {pattern: deanchor(sub.source), names: sub.xregexp.captureNames || []};
  1991. }
  1992. }
  1993. // Passing to XRegExp dies on octals and ensures the outer pattern is independently valid;
  1994. // helps keep this simple. Named captures will be put back
  1995. pattern = asXRegExp(pattern);
  1996. outerCapNames = pattern.xregexp.captureNames || [];
  1997. pattern = pattern.source.replace(parts, function ($0, $1, $2, $3, $4) {
  1998. var subName = $1 || $2, capName, intro;
  1999. if (subName) { // Named subpattern
  2000. if (!data.hasOwnProperty(subName)) {
  2001. throw new ReferenceError("undefined property " + $0);
  2002. }
  2003. if ($1) { // Named subpattern was wrapped in a capturing group
  2004. capName = outerCapNames[numOuterCaps];
  2005. outerCapsMap[++numOuterCaps] = ++numCaps;
  2006. // If it's a named group, preserve the name. Otherwise, use the subpattern name
  2007. // as the capture name
  2008. intro = "(?<" + (capName || subName) + ">";
  2009. } else {
  2010. intro = "(?:";
  2011. }
  2012. numPriorCaps = numCaps;
  2013. return intro + data[subName].pattern.replace(subparts, function (match, paren, backref) {
  2014. if (paren) { // Capturing group
  2015. capName = data[subName].names[numCaps - numPriorCaps];
  2016. ++numCaps;
  2017. if (capName) { // If the current capture has a name, preserve the name
  2018. return "(?<" + capName + ">";
  2019. }
  2020. } else if (backref) { // Backreference
  2021. return "\\" + (+backref + numPriorCaps); // Rewrite the backreference
  2022. }
  2023. return match;
  2024. }) + ")";
  2025. }
  2026. if ($3) { // Capturing group
  2027. capName = outerCapNames[numOuterCaps];
  2028. outerCapsMap[++numOuterCaps] = ++numCaps;
  2029. if (capName) { // If the current capture has a name, preserve the name
  2030. return "(?<" + capName + ">";
  2031. }
  2032. } else if ($4) { // Backreference
  2033. return "\\" + outerCapsMap[+$4]; // Rewrite the backreference
  2034. }
  2035. return $0;
  2036. });
  2037. return XRegExp(pattern, flags);
  2038. };
  2039. }(XRegExp));
  2040. /***** prototypes.js *****/
  2041. /*!
  2042. * XRegExp Prototype Methods v1.0.0
  2043. * (c) 2012 Steven Levithan <http://xregexp.com/>
  2044. * MIT License
  2045. */
  2046. /**
  2047. * Adds a collection of methods to `XRegExp.prototype`. RegExp objects copied by XRegExp are also
  2048. * augmented with any `XRegExp.prototype` methods. Hence, the following work equivalently:
  2049. *
  2050. * XRegExp('[a-z]', 'ig').xexec('abc');
  2051. * XRegExp(/[a-z]/ig).xexec('abc');
  2052. * XRegExp.globalize(/[a-z]/i).xexec('abc');
  2053. */
  2054. (function (XRegExp) {
  2055. "use strict";
  2056. /**
  2057. * Copy properties of `b` to `a`.
  2058. * @private
  2059. * @param {Object} a Object that will receive new properties.
  2060. * @param {Object} b Object whose properties will be copied.
  2061. */
  2062. function extend(a, b) {
  2063. for (var p in b) {
  2064. if (b.hasOwnProperty(p)) {
  2065. a[p] = b[p];
  2066. }
  2067. }
  2068. //return a;
  2069. }
  2070. extend(XRegExp.prototype, {
  2071. /**
  2072. * Implicitly calls the regex's `test` method with the first value in the provided arguments array.
  2073. * @memberOf XRegExp.prototype
  2074. * @param {*} context Ignored. Accepted only for congruity with `Function.prototype.apply`.
  2075. * @param {Array} args Array with the string to search as its first value.
  2076. * @returns {Boolean} Whether the regex matched the provided value.
  2077. * @example
  2078. *
  2079. * XRegExp('[a-z]').apply(null, ['abc']); // -> true
  2080. */
  2081. apply: function (context, args) {
  2082. return this.test(args[0]);
  2083. },
  2084. /**
  2085. * Implicitly calls the regex's `test` method with the provided string.
  2086. * @memberOf XRegExp.prototype
  2087. * @param {*} context Ignored. Accepted only for congruity with `Function.prototype.call`.
  2088. * @param {String} str String to search.
  2089. * @returns {Boolean} Whether the regex matched the provided value.
  2090. * @example
  2091. *
  2092. * XRegExp('[a-z]').call(null, 'abc'); // -> true
  2093. */
  2094. call: function (context, str) {
  2095. return this.test(str);
  2096. },
  2097. /**
  2098. * Implicitly calls {@link #XRegExp.forEach}.
  2099. * @memberOf XRegExp.prototype
  2100. * @example
  2101. *
  2102. * XRegExp('\\d').forEach('1a2345', function (match, i) {
  2103. * if (i % 2) this.push(+match[0]);
  2104. * }, []);
  2105. * // -> [2, 4]
  2106. */
  2107. forEach: function (str, callback, context) {
  2108. return XRegExp.forEach(str, this, callback, context);
  2109. },
  2110. /**
  2111. * Implicitly calls {@link #XRegExp.globalize}.
  2112. * @memberOf XRegExp.prototype
  2113. * @example
  2114. *
  2115. * var globalCopy = XRegExp('regex').globalize();
  2116. * globalCopy.global; // -> true
  2117. */
  2118. globalize: function () {
  2119. return XRegExp.globalize(this);
  2120. },
  2121. /**
  2122. * Implicitly calls {@link #XRegExp.exec}.
  2123. * @memberOf XRegExp.prototype
  2124. * @example
  2125. *
  2126. * var match = XRegExp('U\\+(?<hex>[0-9A-F]{4})').xexec('U+2620');
  2127. * match.hex; // -> '2620'
  2128. */
  2129. xexec: function (str, pos, sticky) {
  2130. return XRegExp.exec(str, this, pos, sticky);
  2131. },
  2132. /**
  2133. * Implicitly calls {@link #XRegExp.test}.
  2134. * @memberOf XRegExp.prototype
  2135. * @example
  2136. *
  2137. * XRegExp('c').xtest('abc'); // -> true
  2138. */
  2139. xtest: function (str, pos, sticky) {
  2140. return XRegExp.test(str, this, pos, sticky);
  2141. }
  2142. });
  2143. }(XRegExp));