JAL-1807 includes ?j2sdebug flag and DebugJS._(msg)
[jalviewjs.git] / bin / com / stevesoft / pat / Regex.js
index d05b95e..893eaa7 100644 (file)
-Clazz.declarePackage ("com.stevesoft.pat");\r
-Clazz.load (["com.stevesoft.pat.RegRes", "$.UniValidator", "jalview.jsdev.api.RegExpInterface", "com.stevesoft.pat.NoPattern", "$.Pthings", "$.patInt", "java.util.Hashtable"], ["com.stevesoft.pat.UnicodeW", "$.UnicodeCurrency", "$.UnicodeAlpha", "$.UnicodeUpper", "$.NUnicodeCurrency", "$.NUnicodeW", "$.NUnicodeAlpha", "$.UnicodeMath", "$.UnicodeWhite", "$.UnicodeDigit", "$.NUnicodeMath", "$.Regex", "$.NUnicodeDigit", "$.NUnicodeWhite", "$.NUnicodePunct", "$.UnicodePunct", "$.UnicodeLower"], ["com.stevesoft.pat.Any", "$.BackG", "$.BackMatch", "$.Backup", "$.Boundary", "$.Bracket", "$.CaseMgr", "$.Ctrl", "$.Custom", "$.CustomEndpoint", "$.DotMulti", "$.End", "$.FastMulti", "$.Group", "$.MessageManager", "$.Multi", "$.NullPattern", "$.Or", "$.OrMark", "$.Prop", "$.Range", "$.RegOpt", "$.RegSyntax", "$.RegSyntaxError", "$.ReplaceRule", "$.Replacer", "$.Rthings", "$.Skip", "$.Skipped", "$.Start", "$.StrPos", "$.lookAhead", "$.oneChar", "$.parsePerl", "$.patInf", "com.stevesoft.pat.wrap.StringWrap", "java.lang.NullPointerException", "$.StringBuffer", "java.util.BitSet"], function () {\r
-c$ = Clazz.declareType (com.stevesoft.pat, "UnicodePunct", com.stevesoft.pat.UniValidator);\r
-Clazz.overrideMethod (c$, "validate", \r
-function (s, from, to) {\r
-return from < s.length () && com.stevesoft.pat.Prop.isPunct (s.charAt (from)) ? to : -1;\r
-}, "com.stevesoft.pat.StringLike,~N,~N");\r
-c$ = Clazz.declareType (com.stevesoft.pat, "UnicodeWhite", com.stevesoft.pat.UniValidator);\r
-Clazz.overrideMethod (c$, "validate", \r
-function (s, from, to) {\r
-return from < s.length () && com.stevesoft.pat.Prop.isWhite (s.charAt (from)) ? to : -1;\r
-}, "com.stevesoft.pat.StringLike,~N,~N");\r
-c$ = Clazz.declareType (com.stevesoft.pat, "NUnicodePunct", com.stevesoft.pat.UniValidator);\r
-Clazz.overrideMethod (c$, "validate", \r
-function (s, from, to) {\r
-return from < s.length () && !com.stevesoft.pat.Prop.isPunct (s.charAt (from)) ? to : -1;\r
-}, "com.stevesoft.pat.StringLike,~N,~N");\r
-c$ = Clazz.declareType (com.stevesoft.pat, "NUnicodeWhite", com.stevesoft.pat.UniValidator);\r
-Clazz.overrideMethod (c$, "validate", \r
-function (s, from, to) {\r
-return from < s.length () && !com.stevesoft.pat.Prop.isWhite (s.charAt (from)) ? to : -1;\r
-}, "com.stevesoft.pat.StringLike,~N,~N");\r
-c$ = Clazz.declareType (com.stevesoft.pat, "UnicodeW", com.stevesoft.pat.UniValidator);\r
-Clazz.overrideMethod (c$, "validate", \r
-function (s, from, to) {\r
-if (from >= s.length ()) {\r
-return -1;\r
-}var c = s.charAt (from);\r
-return (com.stevesoft.pat.Prop.isAlphabetic (c) || com.stevesoft.pat.Prop.isDecimalDigit (c) || c == '_') ? to : -1;\r
-}, "com.stevesoft.pat.StringLike,~N,~N");\r
-c$ = Clazz.declareType (com.stevesoft.pat, "NUnicodeW", com.stevesoft.pat.UniValidator);\r
-Clazz.overrideMethod (c$, "validate", \r
-function (s, from, to) {\r
-if (from >= s.length ()) {\r
-return -1;\r
-}var c = s.charAt (from);\r
-return !(com.stevesoft.pat.Prop.isAlphabetic (c) || com.stevesoft.pat.Prop.isDecimalDigit (c) || c == '_') ? to : -1;\r
-}, "com.stevesoft.pat.StringLike,~N,~N");\r
-c$ = Clazz.declareType (com.stevesoft.pat, "UnicodeDigit", com.stevesoft.pat.UniValidator);\r
-Clazz.overrideMethod (c$, "validate", \r
-function (s, from, to) {\r
-return from < s.length () && com.stevesoft.pat.Prop.isDecimalDigit (s.charAt (from)) ? to : -1;\r
-}, "com.stevesoft.pat.StringLike,~N,~N");\r
-c$ = Clazz.declareType (com.stevesoft.pat, "NUnicodeDigit", com.stevesoft.pat.UniValidator);\r
-Clazz.overrideMethod (c$, "validate", \r
-function (s, from, to) {\r
-return from < s.length () && !com.stevesoft.pat.Prop.isDecimalDigit (s.charAt (from)) ? to : -1;\r
-}, "com.stevesoft.pat.StringLike,~N,~N");\r
-c$ = Clazz.declareType (com.stevesoft.pat, "UnicodeMath", com.stevesoft.pat.UniValidator);\r
-Clazz.overrideMethod (c$, "validate", \r
-function (s, from, to) {\r
-return from < s.length () && com.stevesoft.pat.Prop.isMath (s.charAt (from)) ? to : -1;\r
-}, "com.stevesoft.pat.StringLike,~N,~N");\r
-c$ = Clazz.declareType (com.stevesoft.pat, "NUnicodeMath", com.stevesoft.pat.UniValidator);\r
-Clazz.overrideMethod (c$, "validate", \r
-function (s, from, to) {\r
-return from < s.length () && !com.stevesoft.pat.Prop.isMath (s.charAt (from)) ? to : -1;\r
-}, "com.stevesoft.pat.StringLike,~N,~N");\r
-c$ = Clazz.declareType (com.stevesoft.pat, "UnicodeCurrency", com.stevesoft.pat.UniValidator);\r
-Clazz.overrideMethod (c$, "validate", \r
-function (s, from, to) {\r
-return from < s.length () && com.stevesoft.pat.Prop.isCurrency (s.charAt (from)) ? to : -1;\r
-}, "com.stevesoft.pat.StringLike,~N,~N");\r
-c$ = Clazz.declareType (com.stevesoft.pat, "NUnicodeCurrency", com.stevesoft.pat.UniValidator);\r
-Clazz.overrideMethod (c$, "validate", \r
-function (s, from, to) {\r
-return from < s.length () && !com.stevesoft.pat.Prop.isCurrency (s.charAt (from)) ? to : -1;\r
-}, "com.stevesoft.pat.StringLike,~N,~N");\r
-c$ = Clazz.declareType (com.stevesoft.pat, "UnicodeAlpha", com.stevesoft.pat.UniValidator);\r
-Clazz.overrideMethod (c$, "validate", \r
-function (s, from, to) {\r
-return from < s.length () && com.stevesoft.pat.Prop.isAlphabetic (s.charAt (from)) ? to : -1;\r
-}, "com.stevesoft.pat.StringLike,~N,~N");\r
-c$ = Clazz.declareType (com.stevesoft.pat, "NUnicodeAlpha", com.stevesoft.pat.UniValidator);\r
-Clazz.overrideMethod (c$, "validate", \r
-function (s, from, to) {\r
-return from < s.length () && !com.stevesoft.pat.Prop.isAlphabetic (s.charAt (from)) ? to : -1;\r
-}, "com.stevesoft.pat.StringLike,~N,~N");\r
-c$ = Clazz.declareType (com.stevesoft.pat, "UnicodeUpper", com.stevesoft.pat.UniValidator);\r
-Clazz.overrideMethod (c$, "validate", \r
-function (s, from, to) {\r
-return from < s.length () && this.isUpper (s.charAt (from)) ? to : -1;\r
-}, "com.stevesoft.pat.StringLike,~N,~N");\r
-Clazz.defineMethod (c$, "isUpper", \r
-function (c) {\r
-return c == com.stevesoft.pat.CaseMgr.toUpperCaseC (c) && c != com.stevesoft.pat.CaseMgr.toLowerCaseC (c);\r
-}, "~S");\r
-c$ = Clazz.declareType (com.stevesoft.pat, "UnicodeLower", com.stevesoft.pat.UniValidator);\r
-Clazz.overrideMethod (c$, "validate", \r
-function (s, from, to) {\r
-return from < s.length () && this.isLower (s.charAt (from)) ? to : -1;\r
-}, "com.stevesoft.pat.StringLike,~N,~N");\r
-Clazz.defineMethod (c$, "isLower", \r
-function (c) {\r
-return c != com.stevesoft.pat.CaseMgr.toUpperCaseC (c) && c == com.stevesoft.pat.CaseMgr.toLowerCaseC (c);\r
-}, "~S");\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.thePattern = null;\r
-this.minMatch = null;\r
-this.rep = null;\r
-this.dontMatchInQuotes = false;\r
-this.ignoreCase = false;\r
-this.repr = null;\r
-this.esc = '\\';\r
-this.pt = null;\r
-this.gFlags = null;\r
-this.gFlagto = 0;\r
-this.gFlag = false;\r
-this.sFlag = false;\r
-this.mFlag = false;\r
-this.p = null;\r
-this.or = null;\r
-this.skipper = null;\r
-Clazz.instantialize (this, arguments);\r
-}, com.stevesoft.pat, "Regex", com.stevesoft.pat.RegRes, [jalview.jsdev.api.RegExpInterface, Cloneable]);\r
-Clazz.prepareFields (c$, function () {\r
-this.thePattern = com.stevesoft.pat.Regex.none;\r
-this.minMatch =  new com.stevesoft.pat.patInt (0);\r
-this.pt =  new com.stevesoft.pat.Pthings ();\r
-});\r
-Clazz.makeConstructor (c$, \r
-function (s, strRp) {\r
-Clazz.superConstructor (this, com.stevesoft.pat.Regex, []);\r
-try {\r
-if (s != null) this.compile (s);\r
-if (strRp.length > 0) this.rep = com.stevesoft.pat.ReplaceRule.perlCode (strRp);\r
-} catch (rs) {\r
-if (Clazz.exceptionOf (rs, com.stevesoft.pat.RegSyntax)) {\r
-} else {\r
-throw rs;\r
-}\r
-}\r
-}, "~S,~S");\r
-Clazz.overrideMethod (c$, "clone", \r
-function () {\r
-return  new com.stevesoft.pat.Regex (null, "").cloneFrom (this);\r
-});\r
-Clazz.defineMethod (c$, "cloneFrom", \r
-function (r) {\r
-this.copyOutOf (r);\r
-this.dontMatchInQuotes = r.dontMatchInQuotes;\r
-this.esc = r.esc;\r
-this.ignoreCase = r.ignoreCase;\r
-this.gFlag = r.gFlag;\r
-if (r.rep == null) {\r
-this.rep = null;\r
-} else {\r
-this.rep = r.rep.clone ();\r
-}this.thePattern = r.thePattern.clone ( new java.util.Hashtable ());\r
-this.minMatch = r.minMatch;\r
-this.skipper = r.skipper;\r
-return this;\r
-}, "com.stevesoft.pat.Regex");\r
-Clazz.defineMethod (c$, "setDontMatchInQuotes", \r
-function (b) {\r
-this.dontMatchInQuotes = b;\r
-}, "~B");\r
-Clazz.defineMethod (c$, "getDontMatchInQuotes", \r
-function () {\r
-return this.dontMatchInQuotes;\r
-});\r
-Clazz.overrideMethod (c$, "setIgnoreCase", \r
-function (b) {\r
-this.ignoreCase = b;\r
-}, "~B");\r
-Clazz.defineMethod (c$, "getIgnoreCase", \r
-function () {\r
-return this.ignoreCase;\r
-});\r
-c$.setDefaultMFlag = Clazz.defineMethod (c$, "setDefaultMFlag", \r
-function (mFlag) {\r
-com.stevesoft.pat.Regex.defaultMFlag = mFlag;\r
-}, "~B");\r
-c$.getDefaultMFlag = Clazz.defineMethod (c$, "getDefaultMFlag", \r
-function () {\r
-return com.stevesoft.pat.Regex.defaultMFlag;\r
-});\r
-Clazz.defineMethod (c$, "setReplaceRuleStr", \r
-function (rp) {\r
-this.rep = com.stevesoft.pat.ReplaceRule.perlCode (rp);\r
-this.repr = null;\r
-}, "~S");\r
-Clazz.defineMethod (c$, "setReplaceRule", \r
-function (rp) {\r
-this.rep = rp;\r
-}, "com.stevesoft.pat.ReplaceRule");\r
-c$.isDefined = Clazz.defineMethod (c$, "isDefined", \r
-function (nm) {\r
-return com.stevesoft.pat.Regex.validators.get (nm) != null;\r
-}, "~S");\r
-c$.undefine = Clazz.defineMethod (c$, "undefine", \r
-function (nm) {\r
-com.stevesoft.pat.Regex.validators.remove (nm);\r
-}, "~S");\r
-c$.defineV = Clazz.defineMethod (c$, "defineV", \r
-function (nm, pat, v) {\r
-v.pattern = pat;\r
-com.stevesoft.pat.Regex.validators.put (nm, v);\r
-}, "~S,~S,com.stevesoft.pat.Validator");\r
-c$.define = Clazz.defineMethod (c$, "define", \r
-function (nm, pat) {\r
-com.stevesoft.pat.Regex.validators.put (nm, pat);\r
-}, "~S,~S");\r
-Clazz.defineMethod (c$, "getReplaceRule", \r
-function () {\r
-return this.rep;\r
-});\r
-Clazz.defineMethod (c$, "_getReplacer", \r
-function () {\r
-return this.repr == null ? this.repr =  new com.stevesoft.pat.Replacer () : this.repr;\r
-});\r
-Clazz.defineMethod (c$, "getReplacer", \r
-function () {\r
-if (this.repr == null) {\r
-this.repr =  new com.stevesoft.pat.Replacer ();\r
-}this.repr.rh.me = this;\r
-this.repr.rh.prev = null;\r
-return this.repr;\r
-});\r
-Clazz.defineMethod (c$, "replaceFirst", \r
-function (s) {\r
-return this._getReplacer ().replaceFirstRegion (s, this, 0, s.length).toString ();\r
-}, "~S");\r
-Clazz.defineMethod (c$, "replaceFirstFrom", \r
-function (s, pos) {\r
-return this._getReplacer ().replaceFirstRegion (s, this, pos, s.length).toString ();\r
-}, "~S,~N");\r
-Clazz.defineMethod (c$, "replaceFirstRegion", \r
-function (s, start, end) {\r
-return this._getReplacer ().replaceFirstRegion (s, this, start, end).toString ();\r
-}, "~S,~N,~N");\r
-Clazz.overrideMethod (c$, "replaceAll", \r
-function (s) {\r
-return this._getReplacer ().replaceAllRegion (s, this, 0, s.length).toString ();\r
-}, "~S");\r
-Clazz.defineMethod (c$, "replaceAllLike", \r
-function (s) {\r
-return this._getReplacer ().replaceAllRegion (s, this, 0, s.length ());\r
-}, "com.stevesoft.pat.StringLike");\r
-Clazz.defineMethod (c$, "replaceAllFrom", \r
-function (s, pos) {\r
-return this._getReplacer ().replaceAllRegion (s, this, pos, s.length).toString ();\r
-}, "~S,~N");\r
-Clazz.defineMethod (c$, "replaceAllRegion", \r
-function (s, start, end) {\r
-return this._getReplacer ().replaceAllRegion (s, this, start, end).toString ();\r
-}, "~S,~N,~N");\r
-Clazz.defineMethod (c$, "compile", \r
-function (prepat) {\r
-var postpat = com.stevesoft.pat.parsePerl.codify (prepat, true);\r
-var pat = postpat == null ? prepat : postpat;\r
-this.minMatch = null;\r
-this.ignoreCase = false;\r
-this.dontMatchInQuotes = false;\r
-var mk =  new com.stevesoft.pat.Rthings (this);\r
-var offset = mk.val;\r
-var newpat = pat;\r
-this.thePattern = com.stevesoft.pat.Regex.none;\r
-this.p = null;\r
-this.or = null;\r
-this.minMatch =  new com.stevesoft.pat.patInt (0);\r
-var sp =  new com.stevesoft.pat.StrPos (pat, 0);\r
-if (sp.incMatch ("(?e=")) {\r
-var newEsc = sp.c;\r
-sp.inc ();\r
-if (sp.match (')')) {\r
-newpat = com.stevesoft.pat.Regex.reEscape (pat.substring (6), newEsc, '\\');\r
-}} else if (this.esc != '\\') {\r
-newpat = com.stevesoft.pat.Regex.reEscape (pat, this.esc, '\\');\r
-}this.thePattern = this._compile (newpat, mk);\r
-this.numSubs_ = mk.val - offset;\r
-mk.set (this);\r
-}, "~S");\r
-Clazz.defineMethod (c$, "equals", \r
-function (o) {\r
-if (Clazz.instanceOf (o, com.stevesoft.pat.Regex)) {\r
-if (this.toString ().equals (o.toString ())) {\r
-return Clazz.superCall (this, com.stevesoft.pat.Regex, "equals", [o]);\r
-} else {\r
-return false;\r
-}} else {\r
-return Clazz.superCall (this, com.stevesoft.pat.Regex, "equals", [o]);\r
-}}, "~O");\r
-Clazz.defineMethod (c$, "prep", \r
-function (s) {\r
-this.pt.lastPos = this.matchedTo ();\r
-if (this.pt.lastPos < 0) {\r
-this.pt.lastPos = 0;\r
-}if ((s == null ? null : s.unwrap ()) !== (this.src == null ? null : s.unwrap ())) {\r
-this.pt.lastPos = 0;\r
-}this.src = s;\r
-this.pt.dotDoesntMatchCR = com.stevesoft.pat.Regex.dotDoesntMatchCR && (!this.sFlag);\r
-this.pt.mFlag = ( new Boolean (this.mFlag | com.stevesoft.pat.Regex.defaultMFlag).valueOf ());\r
-this.pt.ignoreCase = this.ignoreCase;\r
-this.pt.no_check = false;\r
-if (this.pt.marks != null) {\r
-for (var i = 0; i < this.pt.marks.length; i++) {\r
-this.pt.marks[i] = -1;\r
-}\r
-}this.pt.marks = null;\r
-this.pt.nMarks = this.numSubs_;\r
-this.pt.src = s;\r
-if (this.dontMatchInQuotes) {\r
-com.stevesoft.pat.Regex.setCbits (s, this.pt);\r
-} else {\r
-this.pt.cbits = null;\r
-}return this.pt;\r
-}, "com.stevesoft.pat.StringLike");\r
-Clazz.defineMethod (c$, "matchAt", \r
-function (s, start_pos) {\r
-return this._search (s, start_pos, start_pos);\r
-}, "~S,~N");\r
-Clazz.defineMethod (c$, "matchAtLike", \r
-function (s, start_pos) {\r
-return this._searchLike (s, start_pos, start_pos);\r
-}, "com.stevesoft.pat.StringLike,~N");\r
-Clazz.overrideMethod (c$, "search", \r
-function (s) {\r
-if (s == null) {\r
-throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.null_string_given_to_regex_search"));\r
-}return this._search (s, 0, s.length);\r
-}, "~S");\r
-Clazz.defineMethod (c$, "searchLike", \r
-function (sl) {\r
-if (sl == null) {\r
-throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.null_string_like_given_to_regex_search"));\r
-}return this._searchLike (sl, 0, sl.length ());\r
-}, "com.stevesoft.pat.StringLike");\r
-Clazz.defineMethod (c$, "reverseSearch", \r
-function (s) {\r
-if (s == null) {\r
-throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.null_string_given_to_regex_reverse_search"));\r
-}return this._reverseSearch (s, 0, s.length);\r
-}, "~S");\r
-Clazz.defineMethod (c$, "reverseSearchLike", \r
-function (sl) {\r
-if (sl == null) {\r
-throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.null_string_like_given_to_regex_reverse_search"));\r
-}return this._reverseSearchLike (sl, 0, sl.length ());\r
-}, "com.stevesoft.pat.StringLike");\r
-Clazz.overrideMethod (c$, "searchFrom", \r
-function (s, start) {\r
-if (s == null) {\r
-throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.null_string_like_given_to_regex_search_from"));\r
-}return this._search (s, start, s.length);\r
-}, "~S,~N");\r
-Clazz.defineMethod (c$, "searchFromLike", \r
-function (s, start) {\r
-if (s == null) {\r
-throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.null_string_like_given_to_regex_search_from"));\r
-}return this._searchLike (s, start, s.length ());\r
-}, "com.stevesoft.pat.StringLike,~N");\r
-Clazz.defineMethod (c$, "searchRegion", \r
-function (s, start, end) {\r
-if (s == null) {\r
-throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.null_string_like_given_to_regex_search_region"));\r
-}return this._search (s, start, end);\r
-}, "~S,~N,~N");\r
-Clazz.defineMethod (c$, "setGFlag", \r
-function (b) {\r
-this.gFlag = b;\r
-}, "~B");\r
-Clazz.defineMethod (c$, "getGFlag", \r
-function () {\r
-return this.gFlag;\r
-});\r
-Clazz.defineMethod (c$, "getSFlag", \r
-function () {\r
-return this.sFlag;\r
-});\r
-Clazz.defineMethod (c$, "getMFlag", \r
-function () {\r
-return this.mFlag;\r
-});\r
-Clazz.defineMethod (c$, "_search", \r
-function (s, start, end) {\r
-return this._searchLike ( new com.stevesoft.pat.wrap.StringWrap (s), start, end);\r
-}, "~S,~N,~N");\r
-Clazz.defineMethod (c$, "_searchLike", \r
-function (s, start, end) {\r
-if (this.gFlag && this.gFlagto > 0 && this.gFlags != null && s.unwrap () === this.gFlags.unwrap ()) {\r
-start = this.gFlagto;\r
-}this.gFlags = null;\r
-var pt = this.prep (s);\r
-var up = (this.minMatch == null ? end : end - this.minMatch.i);\r
-if (up < start && end >= start) {\r
-up = start;\r
-}if (this.skipper == null) {\r
-for (var i = start; i <= up; i++) {\r
-this.charsMatched_ = this.thePattern.matchAt (s, i, pt);\r
-if (this.charsMatched_ >= 0) {\r
-this.matchFrom_ = this.thePattern.mfrom;\r
-this.marks = pt.marks;\r
-this.gFlagto = this.matchFrom_ + this.charsMatched_;\r
-this.gFlags = s;\r
-return this.didMatch_ = true;\r
-}}\r
-} else {\r
-pt.no_check = true;\r
-for (var i = start; i <= up; i++) {\r
-i = this.skipper.find (this.src, i, up);\r
-if (i < 0) {\r
-this.charsMatched_ = this.matchFrom_ = -1;\r
-return this.didMatch_ = false;\r
-}this.charsMatched_ = this.thePattern.matchAt (s, i, pt);\r
-if (this.charsMatched_ >= 0) {\r
-this.matchFrom_ = this.thePattern.mfrom;\r
-this.marks = pt.marks;\r
-this.gFlagto = this.matchFrom_ + this.charsMatched_;\r
-this.gFlags = s;\r
-return this.didMatch_ = true;\r
-}}\r
-}return this.didMatch_ = false;\r
-}, "com.stevesoft.pat.StringLike,~N,~N");\r
-Clazz.defineMethod (c$, "_reverseSearch", \r
-function (s, start, end) {\r
-return this._reverseSearchLike ( new com.stevesoft.pat.wrap.StringWrap (s), start, end);\r
-}, "~S,~N,~N");\r
-Clazz.defineMethod (c$, "_reverseSearchLike", \r
-function (s, start, end) {\r
-if (this.gFlag && this.gFlagto > 0 && s.unwrap () === this.gFlags.unwrap ()) {\r
-end = this.gFlagto;\r
-}this.gFlags = null;\r
-var pt = this.prep (s);\r
-for (var i = end; i >= start; i--) {\r
-this.charsMatched_ = this.thePattern.matchAt (s, i, pt);\r
-if (this.charsMatched_ >= 0) {\r
-this.matchFrom_ = this.thePattern.mfrom;\r
-this.marks = pt.marks;\r
-this.gFlagto = this.matchFrom_ - 1;\r
-this.gFlags = s;\r
-return this.didMatch_ = true;\r
-}}\r
-return this.didMatch_ = false;\r
-}, "com.stevesoft.pat.StringLike,~N,~N");\r
-c$.setCbits = Clazz.defineMethod (c$, "setCbits", \r
-function (s, pt) {\r
-if (s === com.stevesoft.pat.Regex.lasts) {\r
-pt.cbits = com.stevesoft.pat.Regex.lastbs;\r
-return;\r
-}var bs =  new java.util.BitSet (s.length ());\r
-var qc = ' ';\r
-var setBit = false;\r
-for (var i = 0; i < s.length (); i++) {\r
-if (setBit) {\r
-bs.set (i);\r
-}var c = s.charAt (i);\r
-if (!setBit && c == '"') {\r
-qc = c;\r
-setBit = true;\r
-bs.set (i);\r
-} else if (!setBit && c == '\'') {\r
-qc = c;\r
-setBit = true;\r
-bs.set (i);\r
-} else if (setBit && c == qc) {\r
-setBit = false;\r
-} else if (setBit && c == '\\' && i + 1 < s.length ()) {\r
-i++;\r
-if (setBit) {\r
-bs.set (i);\r
-}}}\r
-pt.cbits = com.stevesoft.pat.Regex.lastbs = bs;\r
-com.stevesoft.pat.Regex.lasts = s;\r
-}, "com.stevesoft.pat.StringLike,com.stevesoft.pat.Pthings");\r
-Clazz.defineMethod (c$, "add", \r
-function (p2) {\r
-if (this.p == null) {\r
-this.p = p2;\r
-} else {\r
-this.p.add (p2);\r
-p2 = this.p;\r
-}}, "com.stevesoft.pat.Pattern");\r
-Clazz.defineMethod (c$, "compileSP", \r
-function (sp, mk) {\r
-if (sp.match ('[')) {\r
-sp.inc ();\r
-this.add (this.matchBracket (sp));\r
-} else if (sp.match ('|')) {\r
-if (this.or == null) {\r
-this.or =  new com.stevesoft.pat.Or ();\r
-}if (this.p == null) {\r
-this.p =  new com.stevesoft.pat.NullPattern ();\r
-}this.or.addOr (this.p);\r
-this.p = null;\r
-} else if (sp.incMatch ("(?<")) {\r
-var i = sp.getPatInt ();\r
-if (i == null) {\r
-com.stevesoft.pat.RegSyntaxError.endItAll ("No int after (?<");\r
-}this.add ( new com.stevesoft.pat.Backup (i.intValue ()));\r
-if (!sp.match (')')) {\r
-com.stevesoft.pat.RegSyntaxError.endItAll ("No ) after (?<");\r
-}} else if (sp.incMatch ("(?>")) {\r
-var i = sp.getPatInt ();\r
-if (i == null) {\r
-com.stevesoft.pat.RegSyntaxError.endItAll ("No int after (?>");\r
-}this.add ( new com.stevesoft.pat.Backup (-i.intValue ()));\r
-if (!sp.match (')')) {\r
-com.stevesoft.pat.RegSyntaxError.endItAll ("No ) after (?<");\r
-}} else if (sp.incMatch ("(?@")) {\r
-var op = sp.c;\r
-sp.inc ();\r
-var cl = sp.c;\r
-sp.inc ();\r
-if (!sp.match (')')) {\r
-com.stevesoft.pat.RegSyntaxError.endItAll ("(?@ does not have closing paren");\r
-}this.add ( new com.stevesoft.pat.Group (op, cl));\r
-} else if (sp.incMatch ("(?#")) {\r
-while (!sp.match (')')) {\r
-sp.inc ();\r
-}\r
-} else if (sp.dontMatch && sp.c == 'w') {\r
-var b =  new com.stevesoft.pat.Bracket (false);\r
-b.addOr ( new com.stevesoft.pat.Range ('a', 'z'));\r
-b.addOr ( new com.stevesoft.pat.Range ('A', 'Z'));\r
-b.addOr ( new com.stevesoft.pat.Range ('0', '9'));\r
-b.addOr ( new com.stevesoft.pat.oneChar ('_'));\r
-this.add (b);\r
-} else if (sp.dontMatch && sp.c == 'G') {\r
-this.add ( new com.stevesoft.pat.BackG ());\r
-} else if (sp.dontMatch && sp.c == 's') {\r
-var b =  new com.stevesoft.pat.Bracket (false);\r
-b.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (32)));\r
-b.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (8), String.fromCharCode (10)));\r
-b.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (13)));\r
-this.add (b);\r
-} else if (sp.dontMatch && sp.c == 'd') {\r
-var digit =  new com.stevesoft.pat.Range ('0', '9');\r
-digit.printBrackets = true;\r
-this.add (digit);\r
-} else if (sp.dontMatch && sp.c == 'W') {\r
-var b =  new com.stevesoft.pat.Bracket (true);\r
-b.addOr ( new com.stevesoft.pat.Range ('a', 'z'));\r
-b.addOr ( new com.stevesoft.pat.Range ('A', 'Z'));\r
-b.addOr ( new com.stevesoft.pat.Range ('0', '9'));\r
-b.addOr ( new com.stevesoft.pat.oneChar ('_'));\r
-this.add (b);\r
-} else if (sp.dontMatch && sp.c == 'S') {\r
-var b =  new com.stevesoft.pat.Bracket (true);\r
-b.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (32)));\r
-b.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (8), String.fromCharCode (10)));\r
-b.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (13)));\r
-this.add (b);\r
-} else if (sp.dontMatch && sp.c == 'D') {\r
-var b =  new com.stevesoft.pat.Bracket (true);\r
-b.addOr ( new com.stevesoft.pat.Range ('0', '9'));\r
-this.add (b);\r
-} else if (sp.dontMatch && sp.c == 'B') {\r
-var r =  new com.stevesoft.pat.Regex (null, "");\r
-r._compile ("(?!\\b)", mk);\r
-this.add (r.thePattern);\r
-} else if (this.isOctalString (sp)) {\r
-var d = sp.c.charCodeAt (0) - 48;\r
-sp.inc ();\r
-d = 8 * d + sp.c.charCodeAt (0) - 48;\r
-var sp2 =  new com.stevesoft.pat.StrPos (sp);\r
-sp2.inc ();\r
-if (this.isOctalDigit (sp2, false)) {\r
-sp.inc ();\r
-d = 8 * d + sp.c.charCodeAt (0) - 48;\r
-}this.add ( new com.stevesoft.pat.oneChar (String.fromCharCode (d)));\r
-} else if (sp.dontMatch && sp.c >= '1' && sp.c <= '9') {\r
-var iv = sp.c.charCodeAt (0) - 48;\r
-var s2 =  new com.stevesoft.pat.StrPos (sp);\r
-s2.inc ();\r
-if (!s2.dontMatch && s2.c >= '0' && s2.c <= '9') {\r
-iv = 10 * iv + (s2.c.charCodeAt (0) - 48);\r
-sp.inc ();\r
-}this.add ( new com.stevesoft.pat.BackMatch (iv));\r
-} else if (sp.dontMatch && sp.c == 'b') {\r
-this.add ( new com.stevesoft.pat.Boundary ());\r
-} else if (sp.match ('\b')) {\r
-this.add ( new com.stevesoft.pat.Boundary ());\r
-} else if (sp.match ('$')) {\r
-this.add ( new com.stevesoft.pat.End (true));\r
-} else if (sp.dontMatch && sp.c == 'Z') {\r
-this.add ( new com.stevesoft.pat.End (false));\r
-} else if (sp.match ('.')) {\r
-this.add ( new com.stevesoft.pat.Any ());\r
-} else if (sp.incMatch ("(??")) {\r
-var sb =  new StringBuffer ();\r
-var sb2 =  new StringBuffer ();\r
-while (!sp.match (')') && !sp.match (':')) {\r
-sb.append (sp.c);\r
-sp.inc ();\r
-}\r
-if (sp.incMatch (":")) {\r
-while (!sp.match (')')) {\r
-sb2.append (sp.c);\r
-sp.inc ();\r
-}\r
-}var sbs = sb.toString ();\r
-if (Clazz.instanceOf (com.stevesoft.pat.Regex.validators.get (sbs), String)) {\r
-var pat = com.stevesoft.pat.Regex.validators.get (sbs);\r
-var r =  new com.stevesoft.pat.Regex (null, "");\r
-var rth =  new com.stevesoft.pat.Rthings (this);\r
-rth.noBackRefs = true;\r
-r._compile (pat, rth);\r
-this.add (r.thePattern);\r
-} else {\r
-var cm =  new com.stevesoft.pat.Custom (sb.toString ());\r
-if (cm.v != null) {\r
-var v2 = cm.v.arg (sb2.toString ());\r
-if (v2 != null) {\r
-v2.argsave = sb2.toString ();\r
-var p = cm.v.pattern;\r
-cm.v = v2;\r
-v2.pattern = p;\r
-}var r =  new com.stevesoft.pat.Regex (null, "");\r
-var rth =  new com.stevesoft.pat.Rthings (this);\r
-rth.noBackRefs = true;\r
-r._compile (cm.v.pattern, rth);\r
-cm.sub = r.thePattern;\r
-cm.sub.add ( new com.stevesoft.pat.CustomEndpoint (cm));\r
-cm.sub.setParent (cm);\r
-this.add (cm);\r
-}}} else if (sp.match ('(')) {\r
-mk.parenLevel++;\r
-var r =  new com.stevesoft.pat.Regex (null, "");\r
-sp.inc ();\r
-if (sp.incMatch ("?:")) {\r
-r.or =  new com.stevesoft.pat.Or ();\r
-} else if (sp.incMatch ("?=")) {\r
-r.or =  new com.stevesoft.pat.lookAhead (false);\r
-} else if (sp.incMatch ("?!")) {\r
-r.or =  new com.stevesoft.pat.lookAhead (true);\r
-} else if (sp.match ('?')) {\r
-sp.inc ();\r
-do {\r
-if (sp.c == 'i') {\r
-mk.ignoreCase = true;\r
-}if (sp.c == 'Q') {\r
-mk.dontMatchInQuotes = true;\r
-}if (sp.c == 'o') {\r
-mk.optimizeMe = true;\r
-}if (sp.c == 'g') {\r
-mk.gFlag = true;\r
-}if (sp.c == 's') {\r
-mk.sFlag = true;\r
-}if (sp.c == 'm') {\r
-mk.mFlag = true;\r
-}sp.inc ();\r
-} while (!sp.match (')') && !sp.$eos);\r
-r = null;\r
-mk.parenLevel--;\r
-if (sp.$eos) {\r
-com.stevesoft.pat.RegSyntaxError.endItAll ("Unclosed ()");\r
-}} else {\r
-r.or = mk.noBackRefs ?  new com.stevesoft.pat.Or () :  new com.stevesoft.pat.OrMark (mk.val++);\r
-}if (r != null) {\r
-this.add (r._compileSP (sp, mk));\r
-}} else if (sp.match ('^')) {\r
-this.add ( new com.stevesoft.pat.Start (true));\r
-} else if (sp.dontMatch && sp.c == 'A') {\r
-this.add ( new com.stevesoft.pat.Start (false));\r
-} else if (sp.match ('*')) {\r
-this.addMulti ( new com.stevesoft.pat.patInt (0),  new com.stevesoft.pat.patInf ());\r
-} else if (sp.match ('+')) {\r
-this.addMulti ( new com.stevesoft.pat.patInt (1),  new com.stevesoft.pat.patInf ());\r
-} else if (sp.match ('?')) {\r
-this.addMulti ( new com.stevesoft.pat.patInt (0),  new com.stevesoft.pat.patInt (1));\r
-} else if (sp.match ('{')) {\r
-var bad = false;\r
-var sp2 =  new com.stevesoft.pat.StrPos (sp);\r
-sp.inc ();\r
-var i1 = sp.getPatInt ();\r
-var i2 = null;\r
-if (sp.match ('}')) {\r
-i2 = i1;\r
-} else {\r
-if (!sp.match (',')) {\r
-bad = true;\r
-}sp.inc ();\r
-if (sp.match ('}')) {\r
-i2 =  new com.stevesoft.pat.patInf ();\r
-} else {\r
-i2 = sp.getPatInt ();\r
-}}if (i1 == null || i2 == null) {\r
-bad = true;\r
-}if (bad) {\r
-sp.dup (sp2);\r
-this.add ( new com.stevesoft.pat.oneChar (sp.c));\r
-} else {\r
-this.addMulti (i1, i2);\r
-}} else if (sp.escMatch ('x') && this.next2Hex (sp)) {\r
-sp.inc ();\r
-var d = this.getHexDigit (sp);\r
-sp.inc ();\r
-d = 16 * d + this.getHexDigit (sp);\r
-this.add ( new com.stevesoft.pat.oneChar (String.fromCharCode (d)));\r
-} else if (sp.escMatch ('c')) {\r
-sp.inc ();\r
-if (sp.c.charCodeAt (0) < com.stevesoft.pat.Ctrl.cmap.length) {\r
-this.add ( new com.stevesoft.pat.oneChar (com.stevesoft.pat.Ctrl.cmap[sp.c.charCodeAt (0)]));\r
-} else {\r
-this.add ( new com.stevesoft.pat.oneChar (sp.c));\r
-}} else if (sp.escMatch ('f')) {\r
-this.add ( new com.stevesoft.pat.oneChar (String.fromCharCode (12)));\r
-} else if (sp.escMatch ('a')) {\r
-this.add ( new com.stevesoft.pat.oneChar (String.fromCharCode (7)));\r
-} else if (sp.escMatch ('t')) {\r
-this.add ( new com.stevesoft.pat.oneChar ('\t'));\r
-} else if (sp.escMatch ('n')) {\r
-this.add ( new com.stevesoft.pat.oneChar ('\n'));\r
-} else if (sp.escMatch ('r')) {\r
-this.add ( new com.stevesoft.pat.oneChar ('\r'));\r
-} else if (sp.escMatch ('b')) {\r
-this.add ( new com.stevesoft.pat.oneChar ('\b'));\r
-} else if (sp.escMatch ('e')) {\r
-this.add ( new com.stevesoft.pat.oneChar (String.fromCharCode (27)));\r
-} else {\r
-this.add ( new com.stevesoft.pat.oneChar (sp.c));\r
-if (sp.match (')')) {\r
-com.stevesoft.pat.RegSyntaxError.endItAll ("Unmatched right paren in pattern");\r
-}}}, "com.stevesoft.pat.StrPos,com.stevesoft.pat.Rthings");\r
-Clazz.defineMethod (c$, "_compile", \r
-($fz = function (pat, mk) {\r
-this.minMatch = null;\r
-this.sFlag = this.mFlag = this.ignoreCase = this.gFlag = false;\r
-var sp =  new com.stevesoft.pat.StrPos (pat, 0);\r
-this.thePattern = this._compileSP (sp, mk);\r
-this.pt.marks = null;\r
-return this.thePattern;\r
-}, $fz.isPrivate = true, $fz), "~S,com.stevesoft.pat.Rthings");\r
-Clazz.defineMethod (c$, "_compileSP", \r
-function (sp, mk) {\r
-while (!(sp.$eos || (this.or != null && sp.match (')')))) {\r
-this.compileSP (sp, mk);\r
-sp.inc ();\r
-}\r
-if (sp.match (')')) {\r
-mk.parenLevel--;\r
-} else if (sp.$eos && mk.parenLevel != 0) {\r
-com.stevesoft.pat.RegSyntaxError.endItAll ("Unclosed Parenthesis! lvl=" + mk.parenLevel);\r
-}if (this.or != null) {\r
-if (this.p == null) {\r
-this.p =  new com.stevesoft.pat.NullPattern ();\r
-}this.or.addOr (this.p);\r
-return this.or;\r
-}return this.p == null ?  new com.stevesoft.pat.NullPattern () : this.p;\r
-}, "com.stevesoft.pat.StrPos,com.stevesoft.pat.Rthings");\r
-Clazz.defineMethod (c$, "addMulti", \r
-function (i1, i2) {\r
-var last;\r
-var last2;\r
-for (last = this.p; last != null && last.next != null; last = last.next) {\r
-;}\r
-if (last == null || last === this.p) {\r
-last2 = null;\r
-} else {\r
-for (last2 = this.p; last2.next !== last; last2 = last2.next) {\r
-;}\r
-}if (Clazz.instanceOf (last, com.stevesoft.pat.Multi) && i1.intValue () == 0 && i2.intValue () == 1) {\r
-(last).matchFewest = true;\r
-} else if (Clazz.instanceOf (last, com.stevesoft.pat.FastMulti) && i1.intValue () == 0 && i2.intValue () == 1) {\r
-(last).matchFewest = true;\r
-} else if (Clazz.instanceOf (last, com.stevesoft.pat.DotMulti) && i1.intValue () == 0 && i2.intValue () == 1) {\r
-(last).matchFewest = true;\r
-} else if (Clazz.instanceOf (last, com.stevesoft.pat.Multi) || Clazz.instanceOf (last, com.stevesoft.pat.DotMulti) || Clazz.instanceOf (last, com.stevesoft.pat.FastMulti)) {\r
-throw  new com.stevesoft.pat.RegSyntax ("Syntax error.");\r
-} else if (last2 == null) {\r
-this.p = com.stevesoft.pat.Regex.mkMulti (i1, i2, this.p);\r
-} else {\r
-last2.next = com.stevesoft.pat.Regex.mkMulti (i1, i2, last);\r
-}}, "com.stevesoft.pat.patInt,com.stevesoft.pat.patInt");\r
-c$.mkMulti = Clazz.defineMethod (c$, "mkMulti", \r
-function (lo, hi, p) {\r
-if (Clazz.instanceOf (p, com.stevesoft.pat.Any) && p.next == null) {\r
-return  new com.stevesoft.pat.DotMulti (lo, hi);\r
-}return com.stevesoft.pat.RegOpt.safe4fm (p) ?  new com.stevesoft.pat.FastMulti (lo, hi, p) :  new com.stevesoft.pat.Multi (lo, hi, p);\r
-}, "com.stevesoft.pat.patInt,com.stevesoft.pat.patInt,com.stevesoft.pat.Pattern");\r
-Clazz.defineMethod (c$, "matchBracket", \r
-function (sp) {\r
-var ret;\r
-if (sp.match ('^')) {\r
-ret =  new com.stevesoft.pat.Bracket (true);\r
-sp.inc ();\r
-} else {\r
-ret =  new com.stevesoft.pat.Bracket (false);\r
-}if (sp.match (']')) {\r
-com.stevesoft.pat.RegSyntaxError.endItAll ("Unmatched []");\r
-}while (!sp.$eos && !sp.match (']')) {\r
-var s1 =  new com.stevesoft.pat.StrPos (sp);\r
-s1.inc ();\r
-var s1_ =  new com.stevesoft.pat.StrPos (s1);\r
-s1_.inc ();\r
-if (s1.match ('-') && !s1_.match (']')) {\r
-var s2 =  new com.stevesoft.pat.StrPos (s1);\r
-s2.inc ();\r
-if (!s2.$eos) {\r
-ret.addOr ( new com.stevesoft.pat.Range (sp.c, s2.c));\r
-}sp.inc ();\r
-sp.inc ();\r
-} else if (sp.escMatch ('Q')) {\r
-sp.inc ();\r
-while (!sp.escMatch ('E')) {\r
-ret.addOr ( new com.stevesoft.pat.oneChar (sp.c));\r
-sp.inc ();\r
-}\r
-} else if (sp.escMatch ('d')) {\r
-ret.addOr ( new com.stevesoft.pat.Range ('0', '9'));\r
-} else if (sp.escMatch ('s')) {\r
-ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (32)));\r
-ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (8), String.fromCharCode (10)));\r
-ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (13)));\r
-} else if (sp.escMatch ('w')) {\r
-ret.addOr ( new com.stevesoft.pat.Range ('a', 'z'));\r
-ret.addOr ( new com.stevesoft.pat.Range ('A', 'Z'));\r
-ret.addOr ( new com.stevesoft.pat.Range ('0', '9'));\r
-ret.addOr ( new com.stevesoft.pat.oneChar ('_'));\r
-} else if (sp.escMatch ('D')) {\r
-ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (0), String.fromCharCode (47)));\r
-ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (58), String.fromCharCode (65535)));\r
-} else if (sp.escMatch ('S')) {\r
-ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (0), String.fromCharCode (7)));\r
-ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (11), String.fromCharCode (12)));\r
-ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (14), String.fromCharCode (31)));\r
-ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (33), String.fromCharCode (65535)));\r
-} else if (sp.escMatch ('W')) {\r
-ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (0), String.fromCharCode (64)));\r
-ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (91), String.fromCharCode (94)));\r
-ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (96)));\r
-ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (123), String.fromCharCode (65535)));\r
-} else if (sp.escMatch ('x') && this.next2Hex (sp)) {\r
-sp.inc ();\r
-var d = this.getHexDigit (sp);\r
-sp.inc ();\r
-d = 16 * d + this.getHexDigit (sp);\r
-ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (d)));\r
-} else if (sp.escMatch ('a')) {\r
-ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (7)));\r
-} else if (sp.escMatch ('f')) {\r
-ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (12)));\r
-} else if (sp.escMatch ('e')) {\r
-ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (27)));\r
-} else if (sp.escMatch ('n')) {\r
-ret.addOr ( new com.stevesoft.pat.oneChar ('\n'));\r
-} else if (sp.escMatch ('t')) {\r
-ret.addOr ( new com.stevesoft.pat.oneChar ('\t'));\r
-} else if (sp.escMatch ('r')) {\r
-ret.addOr ( new com.stevesoft.pat.oneChar ('\r'));\r
-} else if (sp.escMatch ('c')) {\r
-sp.inc ();\r
-if (sp.c.charCodeAt (0) < com.stevesoft.pat.Ctrl.cmap.length) {\r
-ret.addOr ( new com.stevesoft.pat.oneChar (com.stevesoft.pat.Ctrl.cmap[sp.c.charCodeAt (0)]));\r
-} else {\r
-ret.addOr ( new com.stevesoft.pat.oneChar (sp.c));\r
-}} else if (this.isOctalString (sp)) {\r
-var d = sp.c.charCodeAt (0) - 48;\r
-sp.inc ();\r
-d = 8 * d + sp.c.charCodeAt (0) - 48;\r
-var sp2 =  new com.stevesoft.pat.StrPos (sp);\r
-sp2.inc ();\r
-if (this.isOctalDigit (sp2, false)) {\r
-sp.inc ();\r
-d = 8 * d + sp.c.charCodeAt (0) - 48;\r
-}ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (d)));\r
-} else {\r
-ret.addOr ( new com.stevesoft.pat.oneChar (sp.c));\r
-}sp.inc ();\r
-}\r
-return ret;\r
-}, "com.stevesoft.pat.StrPos");\r
-Clazz.overrideMethod (c$, "toString", \r
-function () {\r
-{\r
-var sb =  new StringBuffer ();\r
-if (this.esc != '\\') {\r
-sb.append ("(?e=");\r
-sb.append (this.esc);\r
-sb.append (")");\r
-}if (this.gFlag || this.mFlag || !com.stevesoft.pat.Regex.dotDoesntMatchCR || this.sFlag || this.ignoreCase || this.dontMatchInQuotes || this.optimized ()) {\r
-sb.append ("(?");\r
-if (this.ignoreCase) {\r
-sb.append ("i");\r
-}if (this.mFlag) {\r
-sb.append ("m");\r
-}if (this.sFlag || !com.stevesoft.pat.Regex.dotDoesntMatchCR) {\r
-sb.append ("s");\r
-}if (this.dontMatchInQuotes) {\r
-sb.append ("Q");\r
-}if (this.optimized ()) {\r
-sb.append ("o");\r
-}if (this.gFlag) {\r
-sb.append ("g");\r
-}sb.append (")");\r
-}var patstr = this.thePattern.toString ();\r
-if (this.esc != '\\') {\r
-patstr = com.stevesoft.pat.Regex.reEscape (patstr, '\\', this.esc);\r
-}sb.append (patstr);\r
-return sb.toString ();\r
-}});\r
-c$.reEscape = Clazz.defineMethod (c$, "reEscape", \r
-function (s, oldEsc, newEsc) {\r
-if (oldEsc == newEsc) {\r
-return s;\r
-}var i;\r
-var sb =  new StringBuffer ();\r
-for (i = 0; i < s.length; i++) {\r
-if (s.charAt (i) == oldEsc && i + 1 < s.length) {\r
-if (s.charAt (i + 1) == oldEsc) {\r
-sb.append (oldEsc);\r
-} else {\r
-sb.append (newEsc);\r
-sb.append (s.charAt (i + 1));\r
-}i++;\r
-} else if (s.charAt (i) == newEsc) {\r
-sb.append (newEsc);\r
-sb.append (newEsc);\r
-} else {\r
-sb.append (s.charAt (i));\r
-}}\r
-return sb.toString ();\r
-}, "~S,~S,~S");\r
-Clazz.defineMethod (c$, "accept", \r
-function (dir, s) {\r
-return this.search (s);\r
-}, "java.io.File,~S");\r
-c$.version = Clazz.defineMethod (c$, "version", \r
-function () {\r
-return "lgpl release 1.5.3";\r
-});\r
-Clazz.defineMethod (c$, "optimize", \r
-function () {\r
-if (this.optimized () || this.thePattern == null) {\r
-return;\r
-}this.minMatch =  new com.stevesoft.pat.patInt (0);\r
-this.thePattern = com.stevesoft.pat.RegOpt.opt (this.thePattern, this.ignoreCase, this.dontMatchInQuotes);\r
-this.skipper = com.stevesoft.pat.Skip.findSkipRegex (this);\r
-return;\r
-});\r
-Clazz.defineMethod (c$, "optimized", \r
-function () {\r
-return this.minMatch != null;\r
-});\r
-c$.perlCode = Clazz.defineMethod (c$, "perlCode", \r
-function (s) {\r
-return com.stevesoft.pat.parsePerl.parse (s);\r
-}, "~S");\r
-Clazz.defineMethod (c$, "isLiteral", \r
-function () {\r
-var x = this.thePattern;\r
-while (x != null) {\r
-if (Clazz.instanceOf (x, com.stevesoft.pat.oneChar)) {\r
-;} else if (Clazz.instanceOf (x, com.stevesoft.pat.Skipped)) {\r
-;} else {\r
-return false;\r
-}x = x.next;\r
-}\r
-return true;\r
-});\r
-Clazz.defineMethod (c$, "countMinChars", \r
-function () {\r
-return this.thePattern.countMinChars ();\r
-});\r
-Clazz.defineMethod (c$, "countMaxChars", \r
-function () {\r
-return this.thePattern.countMaxChars ();\r
-});\r
-Clazz.defineMethod (c$, "isHexDigit", \r
-function (sp) {\r
-var r = !sp.$eos && !sp.dontMatch && ((sp.c >= '0' && sp.c <= '9') || (sp.c >= 'a' && sp.c <= 'f') || (sp.c >= 'A' && sp.c <= 'F'));\r
-return r;\r
-}, "com.stevesoft.pat.StrPos");\r
-Clazz.defineMethod (c$, "isOctalDigit", \r
-function (sp, first) {\r
-var r = !sp.$eos && !( new Boolean (first ^ sp.dontMatch).valueOf ()) && sp.c >= '0' && sp.c <= '7';\r
-return r;\r
-}, "com.stevesoft.pat.StrPos,~B");\r
-Clazz.defineMethod (c$, "getHexDigit", \r
-function (sp) {\r
-if (sp.c >= '0' && sp.c <= '9') {\r
-return sp.c.charCodeAt (0) - 48;\r
-}if (sp.c >= 'a' && sp.c <= 'f') {\r
-return sp.c.charCodeAt (0) - 97 + 10;\r
-}return sp.c.charCodeAt (0) - 65 + 10;\r
-}, "com.stevesoft.pat.StrPos");\r
-Clazz.defineMethod (c$, "next2Hex", \r
-function (sp) {\r
-var sp2 =  new com.stevesoft.pat.StrPos (sp);\r
-sp2.inc ();\r
-if (!this.isHexDigit (sp2)) {\r
-return false;\r
-}sp2.inc ();\r
-if (!this.isHexDigit (sp2)) {\r
-return false;\r
-}return true;\r
-}, "com.stevesoft.pat.StrPos");\r
-Clazz.defineMethod (c$, "isOctalString", \r
-function (sp) {\r
-if (!this.isOctalDigit (sp, true)) {\r
-return false;\r
-}var sp2 =  new com.stevesoft.pat.StrPos (sp);\r
-sp2.inc ();\r
-if (!this.isOctalDigit (sp2, false)) {\r
-return false;\r
-}return true;\r
-}, "com.stevesoft.pat.StrPos");\r
-Clazz.defineStatics (c$,\r
-"BackRefOffset", 1);\r
-c$.none = c$.prototype.none =  new com.stevesoft.pat.NoPattern ();\r
-c$.validators = c$.prototype.validators =  new java.util.Hashtable ();\r
-{\r
-com.stevesoft.pat.Regex.defineV ("p", "(?>1)",  new com.stevesoft.pat.UnicodePunct ());\r
-com.stevesoft.pat.Regex.defineV ("P", "(?>1)",  new com.stevesoft.pat.NUnicodePunct ());\r
-com.stevesoft.pat.Regex.defineV ("s", "(?>1)",  new com.stevesoft.pat.UnicodeWhite ());\r
-com.stevesoft.pat.Regex.defineV ("S", "(?>1)",  new com.stevesoft.pat.NUnicodeWhite ());\r
-com.stevesoft.pat.Regex.defineV ("w", "(?>1)",  new com.stevesoft.pat.UnicodeW ());\r
-com.stevesoft.pat.Regex.defineV ("W", "(?>1)",  new com.stevesoft.pat.NUnicodeW ());\r
-com.stevesoft.pat.Regex.defineV ("d", "(?>1)",  new com.stevesoft.pat.UnicodeDigit ());\r
-com.stevesoft.pat.Regex.defineV ("D", "(?>1)",  new com.stevesoft.pat.NUnicodeDigit ());\r
-com.stevesoft.pat.Regex.defineV ("m", "(?>1)",  new com.stevesoft.pat.UnicodeMath ());\r
-com.stevesoft.pat.Regex.defineV ("M", "(?>1)",  new com.stevesoft.pat.NUnicodeMath ());\r
-com.stevesoft.pat.Regex.defineV ("c", "(?>1)",  new com.stevesoft.pat.UnicodeCurrency ());\r
-com.stevesoft.pat.Regex.defineV ("C", "(?>1)",  new com.stevesoft.pat.NUnicodeCurrency ());\r
-com.stevesoft.pat.Regex.defineV ("a", "(?>1)",  new com.stevesoft.pat.UnicodeAlpha ());\r
-com.stevesoft.pat.Regex.defineV ("A", "(?>1)",  new com.stevesoft.pat.NUnicodeAlpha ());\r
-com.stevesoft.pat.Regex.defineV ("uc", "(?>1)",  new com.stevesoft.pat.UnicodeUpper ());\r
-com.stevesoft.pat.Regex.defineV ("lc", "(?>1)",  new com.stevesoft.pat.UnicodeLower ());\r
-}Clazz.defineStatics (c$,\r
-"defaultMFlag", false,\r
-"dotDoesntMatchCR", true,\r
-"lasts", null,\r
-"lastbs", null,\r
-"back_slash", '\\');\r
-});\r
+Clazz.declarePackage ("com.stevesoft.pat");
+Clazz.load (["com.stevesoft.pat.RegRes", "$.UniValidator", "jalview.jsdev.api.RegExpInterface", "com.stevesoft.pat.NoPattern", "$.Pthings", "$.patInt", "java.util.Hashtable"], ["com.stevesoft.pat.UnicodeW", "$.UnicodeCurrency", "$.UnicodeAlpha", "$.UnicodeUpper", "$.NUnicodeCurrency", "$.NUnicodeW", "$.NUnicodeAlpha", "$.UnicodeMath", "$.UnicodeWhite", "$.UnicodeDigit", "$.NUnicodeMath", "$.Regex", "$.NUnicodeDigit", "$.NUnicodeWhite", "$.NUnicodePunct", "$.UnicodePunct", "$.UnicodeLower"], ["com.stevesoft.pat.Any", "$.BackG", "$.BackMatch", "$.Backup", "$.Boundary", "$.Bracket", "$.CaseMgr", "$.Ctrl", "$.Custom", "$.CustomEndpoint", "$.DotMulti", "$.End", "$.FastMulti", "$.Group", "$.MessageManager", "$.Multi", "$.NullPattern", "$.Or", "$.OrMark", "$.Prop", "$.Range", "$.RegOpt", "$.RegSyntax", "$.RegSyntaxError", "$.ReplaceRule", "$.Replacer", "$.Rthings", "$.Skip", "$.Skipped", "$.Start", "$.StrPos", "$.lookAhead", "$.oneChar", "$.parsePerl", "$.patInf", "com.stevesoft.pat.wrap.StringWrap", "java.lang.NullPointerException", "$.StringBuffer", "java.util.BitSet"], function () {
+c$ = Clazz.declareType (com.stevesoft.pat, "UnicodePunct", com.stevesoft.pat.UniValidator);
+Clazz.overrideMethod (c$, "validate", 
+function (s, from, to) {
+return from < s.length () && com.stevesoft.pat.Prop.isPunct (s.charAt (from)) ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$ = Clazz.declareType (com.stevesoft.pat, "UnicodeWhite", com.stevesoft.pat.UniValidator);
+Clazz.overrideMethod (c$, "validate", 
+function (s, from, to) {
+return from < s.length () && com.stevesoft.pat.Prop.isWhite (s.charAt (from)) ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$ = Clazz.declareType (com.stevesoft.pat, "NUnicodePunct", com.stevesoft.pat.UniValidator);
+Clazz.overrideMethod (c$, "validate", 
+function (s, from, to) {
+return from < s.length () && !com.stevesoft.pat.Prop.isPunct (s.charAt (from)) ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$ = Clazz.declareType (com.stevesoft.pat, "NUnicodeWhite", com.stevesoft.pat.UniValidator);
+Clazz.overrideMethod (c$, "validate", 
+function (s, from, to) {
+return from < s.length () && !com.stevesoft.pat.Prop.isWhite (s.charAt (from)) ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$ = Clazz.declareType (com.stevesoft.pat, "UnicodeW", com.stevesoft.pat.UniValidator);
+Clazz.overrideMethod (c$, "validate", 
+function (s, from, to) {
+if (from >= s.length ()) {
+return -1;
+}var c = s.charAt (from);
+return (com.stevesoft.pat.Prop.isAlphabetic (c) || com.stevesoft.pat.Prop.isDecimalDigit (c) || c == '_') ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$ = Clazz.declareType (com.stevesoft.pat, "NUnicodeW", com.stevesoft.pat.UniValidator);
+Clazz.overrideMethod (c$, "validate", 
+function (s, from, to) {
+if (from >= s.length ()) {
+return -1;
+}var c = s.charAt (from);
+return !(com.stevesoft.pat.Prop.isAlphabetic (c) || com.stevesoft.pat.Prop.isDecimalDigit (c) || c == '_') ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$ = Clazz.declareType (com.stevesoft.pat, "UnicodeDigit", com.stevesoft.pat.UniValidator);
+Clazz.overrideMethod (c$, "validate", 
+function (s, from, to) {
+return from < s.length () && com.stevesoft.pat.Prop.isDecimalDigit (s.charAt (from)) ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$ = Clazz.declareType (com.stevesoft.pat, "NUnicodeDigit", com.stevesoft.pat.UniValidator);
+Clazz.overrideMethod (c$, "validate", 
+function (s, from, to) {
+return from < s.length () && !com.stevesoft.pat.Prop.isDecimalDigit (s.charAt (from)) ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$ = Clazz.declareType (com.stevesoft.pat, "UnicodeMath", com.stevesoft.pat.UniValidator);
+Clazz.overrideMethod (c$, "validate", 
+function (s, from, to) {
+return from < s.length () && com.stevesoft.pat.Prop.isMath (s.charAt (from)) ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$ = Clazz.declareType (com.stevesoft.pat, "NUnicodeMath", com.stevesoft.pat.UniValidator);
+Clazz.overrideMethod (c$, "validate", 
+function (s, from, to) {
+return from < s.length () && !com.stevesoft.pat.Prop.isMath (s.charAt (from)) ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$ = Clazz.declareType (com.stevesoft.pat, "UnicodeCurrency", com.stevesoft.pat.UniValidator);
+Clazz.overrideMethod (c$, "validate", 
+function (s, from, to) {
+return from < s.length () && com.stevesoft.pat.Prop.isCurrency (s.charAt (from)) ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$ = Clazz.declareType (com.stevesoft.pat, "NUnicodeCurrency", com.stevesoft.pat.UniValidator);
+Clazz.overrideMethod (c$, "validate", 
+function (s, from, to) {
+return from < s.length () && !com.stevesoft.pat.Prop.isCurrency (s.charAt (from)) ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$ = Clazz.declareType (com.stevesoft.pat, "UnicodeAlpha", com.stevesoft.pat.UniValidator);
+Clazz.overrideMethod (c$, "validate", 
+function (s, from, to) {
+return from < s.length () && com.stevesoft.pat.Prop.isAlphabetic (s.charAt (from)) ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$ = Clazz.declareType (com.stevesoft.pat, "NUnicodeAlpha", com.stevesoft.pat.UniValidator);
+Clazz.overrideMethod (c$, "validate", 
+function (s, from, to) {
+return from < s.length () && !com.stevesoft.pat.Prop.isAlphabetic (s.charAt (from)) ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$ = Clazz.declareType (com.stevesoft.pat, "UnicodeUpper", com.stevesoft.pat.UniValidator);
+Clazz.overrideMethod (c$, "validate", 
+function (s, from, to) {
+return from < s.length () && this.isUpper (s.charAt (from)) ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+Clazz.defineMethod (c$, "isUpper", 
+function (c) {
+return c == com.stevesoft.pat.CaseMgr.toUpperCaseC (c) && c != com.stevesoft.pat.CaseMgr.toLowerCaseC (c);
+}, "~S");
+c$ = Clazz.declareType (com.stevesoft.pat, "UnicodeLower", com.stevesoft.pat.UniValidator);
+Clazz.overrideMethod (c$, "validate", 
+function (s, from, to) {
+return from < s.length () && this.isLower (s.charAt (from)) ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+Clazz.defineMethod (c$, "isLower", 
+function (c) {
+return c != com.stevesoft.pat.CaseMgr.toUpperCaseC (c) && c == com.stevesoft.pat.CaseMgr.toLowerCaseC (c);
+}, "~S");
+c$ = Clazz.decorateAsClass (function () {
+this.thePattern = null;
+this.minMatch = null;
+this.rep = null;
+this.dontMatchInQuotes = false;
+this.ignoreCase = false;
+this.repr = null;
+this.esc = '\\';
+this.pt = null;
+this.gFlags = null;
+this.gFlagto = 0;
+this.gFlag = false;
+this.sFlag = false;
+this.mFlag = false;
+this.p = null;
+this.or = null;
+this.skipper = null;
+Clazz.instantialize (this, arguments);
+}, com.stevesoft.pat, "Regex", com.stevesoft.pat.RegRes, [jalview.jsdev.api.RegExpInterface, Cloneable]);
+Clazz.prepareFields (c$, function () {
+this.thePattern = com.stevesoft.pat.Regex.none;
+this.minMatch =  new com.stevesoft.pat.patInt (0);
+this.pt =  new com.stevesoft.pat.Pthings ();
+});
+Clazz.makeConstructor (c$, 
+function (s, strRp) {
+Clazz.superConstructor (this, com.stevesoft.pat.Regex, []);
+try {
+if (s != null) this.compile (s);
+if (strRp.length > 0) this.rep = com.stevesoft.pat.ReplaceRule.perlCode (strRp);
+} catch (rs) {
+if (Clazz.exceptionOf (rs, com.stevesoft.pat.RegSyntax)) {
+} else {
+throw rs;
+}
+}
+}, "~S,~S");
+Clazz.overrideMethod (c$, "clone", 
+function () {
+return  new com.stevesoft.pat.Regex (null, "").cloneFrom (this);
+});
+Clazz.defineMethod (c$, "cloneFrom", 
+function (r) {
+this.copyOutOf (r);
+this.dontMatchInQuotes = r.dontMatchInQuotes;
+this.esc = r.esc;
+this.ignoreCase = r.ignoreCase;
+this.gFlag = r.gFlag;
+if (r.rep == null) {
+this.rep = null;
+} else {
+this.rep = r.rep.clone ();
+}this.thePattern = r.thePattern.clone ( new java.util.Hashtable ());
+this.minMatch = r.minMatch;
+this.skipper = r.skipper;
+return this;
+}, "com.stevesoft.pat.Regex");
+Clazz.defineMethod (c$, "setDontMatchInQuotes", 
+function (b) {
+this.dontMatchInQuotes = b;
+}, "~B");
+Clazz.defineMethod (c$, "getDontMatchInQuotes", 
+function () {
+return this.dontMatchInQuotes;
+});
+Clazz.overrideMethod (c$, "setIgnoreCase", 
+function (b) {
+this.ignoreCase = b;
+}, "~B");
+Clazz.defineMethod (c$, "getIgnoreCase", 
+function () {
+return this.ignoreCase;
+});
+c$.setDefaultMFlag = Clazz.defineMethod (c$, "setDefaultMFlag", 
+function (mFlag) {
+com.stevesoft.pat.Regex.defaultMFlag = mFlag;
+}, "~B");
+c$.getDefaultMFlag = Clazz.defineMethod (c$, "getDefaultMFlag", 
+function () {
+return com.stevesoft.pat.Regex.defaultMFlag;
+});
+Clazz.defineMethod (c$, "setReplaceRuleStr", 
+function (rp) {
+this.rep = com.stevesoft.pat.ReplaceRule.perlCode (rp);
+this.repr = null;
+}, "~S");
+Clazz.defineMethod (c$, "setReplaceRule", 
+function (rp) {
+this.rep = rp;
+}, "com.stevesoft.pat.ReplaceRule");
+c$.isDefined = Clazz.defineMethod (c$, "isDefined", 
+function (nm) {
+return com.stevesoft.pat.Regex.validators.get (nm) != null;
+}, "~S");
+c$.undefine = Clazz.defineMethod (c$, "undefine", 
+function (nm) {
+com.stevesoft.pat.Regex.validators.remove (nm);
+}, "~S");
+c$.defineV = Clazz.defineMethod (c$, "defineV", 
+function (nm, pat, v) {
+v.pattern = pat;
+com.stevesoft.pat.Regex.validators.put (nm, v);
+}, "~S,~S,com.stevesoft.pat.Validator");
+c$.define = Clazz.defineMethod (c$, "define", 
+function (nm, pat) {
+com.stevesoft.pat.Regex.validators.put (nm, pat);
+}, "~S,~S");
+Clazz.defineMethod (c$, "getReplaceRule", 
+function () {
+return this.rep;
+});
+Clazz.defineMethod (c$, "_getReplacer", 
+function () {
+return this.repr == null ? this.repr =  new com.stevesoft.pat.Replacer () : this.repr;
+});
+Clazz.defineMethod (c$, "getReplacer", 
+function () {
+if (this.repr == null) {
+this.repr =  new com.stevesoft.pat.Replacer ();
+}this.repr.rh.me = this;
+this.repr.rh.prev = null;
+return this.repr;
+});
+Clazz.defineMethod (c$, "replaceFirst", 
+function (s) {
+return this._getReplacer ().replaceFirstRegion (s, this, 0, s.length).toString ();
+}, "~S");
+Clazz.defineMethod (c$, "replaceFirstFrom", 
+function (s, pos) {
+return this._getReplacer ().replaceFirstRegion (s, this, pos, s.length).toString ();
+}, "~S,~N");
+Clazz.defineMethod (c$, "replaceFirstRegion", 
+function (s, start, end) {
+return this._getReplacer ().replaceFirstRegion (s, this, start, end).toString ();
+}, "~S,~N,~N");
+Clazz.overrideMethod (c$, "replaceAll", 
+function (s) {
+return this._getReplacer ().replaceAllRegion (s, this, 0, s.length).toString ();
+}, "~S");
+Clazz.defineMethod (c$, "replaceAllLike", 
+function (s) {
+return this._getReplacer ().replaceAllRegion (s, this, 0, s.length ());
+}, "com.stevesoft.pat.StringLike");
+Clazz.defineMethod (c$, "replaceAllFrom", 
+function (s, pos) {
+return this._getReplacer ().replaceAllRegion (s, this, pos, s.length).toString ();
+}, "~S,~N");
+Clazz.defineMethod (c$, "replaceAllRegion", 
+function (s, start, end) {
+return this._getReplacer ().replaceAllRegion (s, this, start, end).toString ();
+}, "~S,~N,~N");
+Clazz.defineMethod (c$, "compile", 
+function (prepat) {
+var postpat = com.stevesoft.pat.parsePerl.codify (prepat, true);
+var pat = postpat == null ? prepat : postpat;
+this.minMatch = null;
+this.ignoreCase = false;
+this.dontMatchInQuotes = false;
+var mk =  new com.stevesoft.pat.Rthings (this);
+var offset = mk.val;
+var newpat = pat;
+this.thePattern = com.stevesoft.pat.Regex.none;
+this.p = null;
+this.or = null;
+this.minMatch =  new com.stevesoft.pat.patInt (0);
+var sp =  new com.stevesoft.pat.StrPos (pat, 0);
+if (sp.incMatch ("(?e=")) {
+var newEsc = sp.c;
+sp.inc ();
+if (sp.match (')')) {
+newpat = com.stevesoft.pat.Regex.reEscape (pat.substring (6), newEsc, '\\');
+}} else if (this.esc != '\\') {
+newpat = com.stevesoft.pat.Regex.reEscape (pat, this.esc, '\\');
+}this.thePattern = this._compile (newpat, mk);
+this.numSubs_ = mk.val - offset;
+mk.set (this);
+}, "~S");
+Clazz.defineMethod (c$, "equals", 
+function (o) {
+if (Clazz.instanceOf (o, com.stevesoft.pat.Regex)) {
+if (this.toString ().equals (o.toString ())) {
+return Clazz.superCall (this, com.stevesoft.pat.Regex, "equals", [o]);
+} else {
+return false;
+}} else {
+return Clazz.superCall (this, com.stevesoft.pat.Regex, "equals", [o]);
+}}, "~O");
+Clazz.defineMethod (c$, "prep", 
+function (s) {
+this.pt.lastPos = this.matchedTo ();
+if (this.pt.lastPos < 0) {
+this.pt.lastPos = 0;
+}if ((s == null ? null : s.unwrap ()) !== (this.src == null ? null : s.unwrap ())) {
+this.pt.lastPos = 0;
+}this.src = s;
+this.pt.dotDoesntMatchCR = com.stevesoft.pat.Regex.dotDoesntMatchCR && (!this.sFlag);
+this.pt.mFlag = ( new Boolean (this.mFlag | com.stevesoft.pat.Regex.defaultMFlag).valueOf ());
+this.pt.ignoreCase = this.ignoreCase;
+this.pt.no_check = false;
+if (this.pt.marks != null) {
+for (var i = 0; i < this.pt.marks.length; i++) {
+this.pt.marks[i] = -1;
+}
+}this.pt.marks = null;
+this.pt.nMarks = this.numSubs_;
+this.pt.src = s;
+if (this.dontMatchInQuotes) {
+com.stevesoft.pat.Regex.setCbits (s, this.pt);
+} else {
+this.pt.cbits = null;
+}return this.pt;
+}, "com.stevesoft.pat.StringLike");
+Clazz.defineMethod (c$, "matchAt", 
+function (s, start_pos) {
+return this._search (s, start_pos, start_pos);
+}, "~S,~N");
+Clazz.defineMethod (c$, "matchAtLike", 
+function (s, start_pos) {
+return this._searchLike (s, start_pos, start_pos);
+}, "com.stevesoft.pat.StringLike,~N");
+Clazz.overrideMethod (c$, "search", 
+function (s) {
+if (s == null) {
+throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.null_string_given_to_regex_search"));
+}return this._search (s, 0, s.length);
+}, "~S");
+Clazz.defineMethod (c$, "searchLike", 
+function (sl) {
+if (sl == null) {
+throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.null_string_like_given_to_regex_search"));
+}return this._searchLike (sl, 0, sl.length ());
+}, "com.stevesoft.pat.StringLike");
+Clazz.defineMethod (c$, "reverseSearch", 
+function (s) {
+if (s == null) {
+throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.null_string_given_to_regex_reverse_search"));
+}return this._reverseSearch (s, 0, s.length);
+}, "~S");
+Clazz.defineMethod (c$, "reverseSearchLike", 
+function (sl) {
+if (sl == null) {
+throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.null_string_like_given_to_regex_reverse_search"));
+}return this._reverseSearchLike (sl, 0, sl.length ());
+}, "com.stevesoft.pat.StringLike");
+Clazz.overrideMethod (c$, "searchFrom", 
+function (s, start) {
+if (s == null) {
+throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.null_string_like_given_to_regex_search_from"));
+}return this._search (s, start, s.length);
+}, "~S,~N");
+Clazz.defineMethod (c$, "searchFromLike", 
+function (s, start) {
+if (s == null) {
+throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.null_string_like_given_to_regex_search_from"));
+}return this._searchLike (s, start, s.length ());
+}, "com.stevesoft.pat.StringLike,~N");
+Clazz.defineMethod (c$, "searchRegion", 
+function (s, start, end) {
+if (s == null) {
+throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.null_string_like_given_to_regex_search_region"));
+}return this._search (s, start, end);
+}, "~S,~N,~N");
+Clazz.defineMethod (c$, "setGFlag", 
+function (b) {
+this.gFlag = b;
+}, "~B");
+Clazz.defineMethod (c$, "getGFlag", 
+function () {
+return this.gFlag;
+});
+Clazz.defineMethod (c$, "getSFlag", 
+function () {
+return this.sFlag;
+});
+Clazz.defineMethod (c$, "getMFlag", 
+function () {
+return this.mFlag;
+});
+Clazz.defineMethod (c$, "_search", 
+function (s, start, end) {
+return this._searchLike ( new com.stevesoft.pat.wrap.StringWrap (s), start, end);
+}, "~S,~N,~N");
+Clazz.defineMethod (c$, "_searchLike", 
+function (s, start, end) {
+if (this.gFlag && this.gFlagto > 0 && this.gFlags != null && s.unwrap () === this.gFlags.unwrap ()) {
+start = this.gFlagto;
+}this.gFlags = null;
+var pt = this.prep (s);
+var up = (this.minMatch == null ? end : end - this.minMatch.i);
+if (up < start && end >= start) {
+up = start;
+}if (this.skipper == null) {
+for (var i = start; i <= up; i++) {
+this.charsMatched_ = this.thePattern.matchAt (s, i, pt);
+if (this.charsMatched_ >= 0) {
+this.matchFrom_ = this.thePattern.mfrom;
+this.marks = pt.marks;
+this.gFlagto = this.matchFrom_ + this.charsMatched_;
+this.gFlags = s;
+return this.didMatch_ = true;
+}}
+} else {
+pt.no_check = true;
+for (var i = start; i <= up; i++) {
+i = this.skipper.find (this.src, i, up);
+if (i < 0) {
+this.charsMatched_ = this.matchFrom_ = -1;
+return this.didMatch_ = false;
+}this.charsMatched_ = this.thePattern.matchAt (s, i, pt);
+if (this.charsMatched_ >= 0) {
+this.matchFrom_ = this.thePattern.mfrom;
+this.marks = pt.marks;
+this.gFlagto = this.matchFrom_ + this.charsMatched_;
+this.gFlags = s;
+return this.didMatch_ = true;
+}}
+}return this.didMatch_ = false;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+Clazz.defineMethod (c$, "_reverseSearch", 
+function (s, start, end) {
+return this._reverseSearchLike ( new com.stevesoft.pat.wrap.StringWrap (s), start, end);
+}, "~S,~N,~N");
+Clazz.defineMethod (c$, "_reverseSearchLike", 
+function (s, start, end) {
+if (this.gFlag && this.gFlagto > 0 && s.unwrap () === this.gFlags.unwrap ()) {
+end = this.gFlagto;
+}this.gFlags = null;
+var pt = this.prep (s);
+for (var i = end; i >= start; i--) {
+this.charsMatched_ = this.thePattern.matchAt (s, i, pt);
+if (this.charsMatched_ >= 0) {
+this.matchFrom_ = this.thePattern.mfrom;
+this.marks = pt.marks;
+this.gFlagto = this.matchFrom_ - 1;
+this.gFlags = s;
+return this.didMatch_ = true;
+}}
+return this.didMatch_ = false;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$.setCbits = Clazz.defineMethod (c$, "setCbits", 
+function (s, pt) {
+if (s === com.stevesoft.pat.Regex.lasts) {
+pt.cbits = com.stevesoft.pat.Regex.lastbs;
+return;
+}var bs =  new java.util.BitSet (s.length ());
+var qc = ' ';
+var setBit = false;
+for (var i = 0; i < s.length (); i++) {
+if (setBit) {
+bs.set (i);
+}var c = s.charAt (i);
+if (!setBit && c == '"') {
+qc = c;
+setBit = true;
+bs.set (i);
+} else if (!setBit && c == '\'') {
+qc = c;
+setBit = true;
+bs.set (i);
+} else if (setBit && c == qc) {
+setBit = false;
+} else if (setBit && c == '\\' && i + 1 < s.length ()) {
+i++;
+if (setBit) {
+bs.set (i);
+}}}
+pt.cbits = com.stevesoft.pat.Regex.lastbs = bs;
+com.stevesoft.pat.Regex.lasts = s;
+}, "com.stevesoft.pat.StringLike,com.stevesoft.pat.Pthings");
+Clazz.defineMethod (c$, "add", 
+function (p2) {
+if (this.p == null) {
+this.p = p2;
+} else {
+this.p.add (p2);
+p2 = this.p;
+}}, "com.stevesoft.pat.Pattern");
+Clazz.defineMethod (c$, "compileSP", 
+function (sp, mk) {
+if (sp.match ('[')) {
+sp.inc ();
+this.add (this.matchBracket (sp));
+} else if (sp.match ('|')) {
+if (this.or == null) {
+this.or =  new com.stevesoft.pat.Or ();
+}if (this.p == null) {
+this.p =  new com.stevesoft.pat.NullPattern ();
+}this.or.addOr (this.p);
+this.p = null;
+} else if (sp.incMatch ("(?<")) {
+var i = sp.getPatInt ();
+if (i == null) {
+com.stevesoft.pat.RegSyntaxError.endItAll ("No int after (?<");
+}this.add ( new com.stevesoft.pat.Backup (i.intValue ()));
+if (!sp.match (')')) {
+com.stevesoft.pat.RegSyntaxError.endItAll ("No ) after (?<");
+}} else if (sp.incMatch ("(?>")) {
+var i = sp.getPatInt ();
+if (i == null) {
+com.stevesoft.pat.RegSyntaxError.endItAll ("No int after (?>");
+}this.add ( new com.stevesoft.pat.Backup (-i.intValue ()));
+if (!sp.match (')')) {
+com.stevesoft.pat.RegSyntaxError.endItAll ("No ) after (?<");
+}} else if (sp.incMatch ("(?@")) {
+var op = sp.c;
+sp.inc ();
+var cl = sp.c;
+sp.inc ();
+if (!sp.match (')')) {
+com.stevesoft.pat.RegSyntaxError.endItAll ("(?@ does not have closing paren");
+}this.add ( new com.stevesoft.pat.Group (op, cl));
+} else if (sp.incMatch ("(?#")) {
+while (!sp.match (')')) {
+sp.inc ();
+}
+} else if (sp.dontMatch && sp.c == 'w') {
+var b =  new com.stevesoft.pat.Bracket (false);
+b.addOr ( new com.stevesoft.pat.Range ('a', 'z'));
+b.addOr ( new com.stevesoft.pat.Range ('A', 'Z'));
+b.addOr ( new com.stevesoft.pat.Range ('0', '9'));
+b.addOr ( new com.stevesoft.pat.oneChar ('_'));
+this.add (b);
+} else if (sp.dontMatch && sp.c == 'G') {
+this.add ( new com.stevesoft.pat.BackG ());
+} else if (sp.dontMatch && sp.c == 's') {
+var b =  new com.stevesoft.pat.Bracket (false);
+b.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (32)));
+b.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (8), String.fromCharCode (10)));
+b.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (13)));
+this.add (b);
+} else if (sp.dontMatch && sp.c == 'd') {
+var digit =  new com.stevesoft.pat.Range ('0', '9');
+digit.printBrackets = true;
+this.add (digit);
+} else if (sp.dontMatch && sp.c == 'W') {
+var b =  new com.stevesoft.pat.Bracket (true);
+b.addOr ( new com.stevesoft.pat.Range ('a', 'z'));
+b.addOr ( new com.stevesoft.pat.Range ('A', 'Z'));
+b.addOr ( new com.stevesoft.pat.Range ('0', '9'));
+b.addOr ( new com.stevesoft.pat.oneChar ('_'));
+this.add (b);
+} else if (sp.dontMatch && sp.c == 'S') {
+var b =  new com.stevesoft.pat.Bracket (true);
+b.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (32)));
+b.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (8), String.fromCharCode (10)));
+b.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (13)));
+this.add (b);
+} else if (sp.dontMatch && sp.c == 'D') {
+var b =  new com.stevesoft.pat.Bracket (true);
+b.addOr ( new com.stevesoft.pat.Range ('0', '9'));
+this.add (b);
+} else if (sp.dontMatch && sp.c == 'B') {
+var r =  new com.stevesoft.pat.Regex (null, "");
+r._compile ("(?!\\b)", mk);
+this.add (r.thePattern);
+} else if (this.isOctalString (sp)) {
+var d = sp.c.charCodeAt (0) - 48;
+sp.inc ();
+d = 8 * d + sp.c.charCodeAt (0) - 48;
+var sp2 =  new com.stevesoft.pat.StrPos (sp);
+sp2.inc ();
+if (this.isOctalDigit (sp2, false)) {
+sp.inc ();
+d = 8 * d + sp.c.charCodeAt (0) - 48;
+}this.add ( new com.stevesoft.pat.oneChar (String.fromCharCode (d)));
+} else if (sp.dontMatch && sp.c >= '1' && sp.c <= '9') {
+var iv = sp.c.charCodeAt (0) - 48;
+var s2 =  new com.stevesoft.pat.StrPos (sp);
+s2.inc ();
+if (!s2.dontMatch && s2.c >= '0' && s2.c <= '9') {
+iv = 10 * iv + (s2.c.charCodeAt (0) - 48);
+sp.inc ();
+}this.add ( new com.stevesoft.pat.BackMatch (iv));
+} else if (sp.dontMatch && sp.c == 'b') {
+this.add ( new com.stevesoft.pat.Boundary ());
+} else if (sp.match ('\b')) {
+this.add ( new com.stevesoft.pat.Boundary ());
+} else if (sp.match ('$')) {
+this.add ( new com.stevesoft.pat.End (true));
+} else if (sp.dontMatch && sp.c == 'Z') {
+this.add ( new com.stevesoft.pat.End (false));
+} else if (sp.match ('.')) {
+this.add ( new com.stevesoft.pat.Any ());
+} else if (sp.incMatch ("(??")) {
+var sb =  new StringBuffer ();
+var sb2 =  new StringBuffer ();
+while (!sp.match (')') && !sp.match (':')) {
+sb.append (sp.c);
+sp.inc ();
+}
+if (sp.incMatch (":")) {
+while (!sp.match (')')) {
+sb2.append (sp.c);
+sp.inc ();
+}
+}var sbs = sb.toString ();
+if (Clazz.instanceOf (com.stevesoft.pat.Regex.validators.get (sbs), String)) {
+var pat = com.stevesoft.pat.Regex.validators.get (sbs);
+var r =  new com.stevesoft.pat.Regex (null, "");
+var rth =  new com.stevesoft.pat.Rthings (this);
+rth.noBackRefs = true;
+r._compile (pat, rth);
+this.add (r.thePattern);
+} else {
+var cm =  new com.stevesoft.pat.Custom (sb.toString ());
+if (cm.v != null) {
+var v2 = cm.v.arg (sb2.toString ());
+if (v2 != null) {
+v2.argsave = sb2.toString ();
+var p = cm.v.pattern;
+cm.v = v2;
+v2.pattern = p;
+}var r =  new com.stevesoft.pat.Regex (null, "");
+var rth =  new com.stevesoft.pat.Rthings (this);
+rth.noBackRefs = true;
+r._compile (cm.v.pattern, rth);
+cm.sub = r.thePattern;
+cm.sub.add ( new com.stevesoft.pat.CustomEndpoint (cm));
+cm.sub.setParent (cm);
+this.add (cm);
+}}} else if (sp.match ('(')) {
+mk.parenLevel++;
+var r =  new com.stevesoft.pat.Regex (null, "");
+sp.inc ();
+if (sp.incMatch ("?:")) {
+r.or =  new com.stevesoft.pat.Or ();
+} else if (sp.incMatch ("?=")) {
+r.or =  new com.stevesoft.pat.lookAhead (false);
+} else if (sp.incMatch ("?!")) {
+r.or =  new com.stevesoft.pat.lookAhead (true);
+} else if (sp.match ('?')) {
+sp.inc ();
+do {
+if (sp.c == 'i') {
+mk.ignoreCase = true;
+}if (sp.c == 'Q') {
+mk.dontMatchInQuotes = true;
+}if (sp.c == 'o') {
+mk.optimizeMe = true;
+}if (sp.c == 'g') {
+mk.gFlag = true;
+}if (sp.c == 's') {
+mk.sFlag = true;
+}if (sp.c == 'm') {
+mk.mFlag = true;
+}sp.inc ();
+} while (!sp.match (')') && !sp.$eos);
+r = null;
+mk.parenLevel--;
+if (sp.$eos) {
+com.stevesoft.pat.RegSyntaxError.endItAll ("Unclosed ()");
+}} else {
+r.or = mk.noBackRefs ?  new com.stevesoft.pat.Or () :  new com.stevesoft.pat.OrMark (mk.val++);
+}if (r != null) {
+this.add (r._compileSP (sp, mk));
+}} else if (sp.match ('^')) {
+this.add ( new com.stevesoft.pat.Start (true));
+} else if (sp.dontMatch && sp.c == 'A') {
+this.add ( new com.stevesoft.pat.Start (false));
+} else if (sp.match ('*')) {
+this.addMulti ( new com.stevesoft.pat.patInt (0),  new com.stevesoft.pat.patInf ());
+} else if (sp.match ('+')) {
+this.addMulti ( new com.stevesoft.pat.patInt (1),  new com.stevesoft.pat.patInf ());
+} else if (sp.match ('?')) {
+this.addMulti ( new com.stevesoft.pat.patInt (0),  new com.stevesoft.pat.patInt (1));
+} else if (sp.match ('{')) {
+var bad = false;
+var sp2 =  new com.stevesoft.pat.StrPos (sp);
+sp.inc ();
+var i1 = sp.getPatInt ();
+var i2 = null;
+if (sp.match ('}')) {
+i2 = i1;
+} else {
+if (!sp.match (',')) {
+bad = true;
+}sp.inc ();
+if (sp.match ('}')) {
+i2 =  new com.stevesoft.pat.patInf ();
+} else {
+i2 = sp.getPatInt ();
+}}if (i1 == null || i2 == null) {
+bad = true;
+}if (bad) {
+sp.dup (sp2);
+this.add ( new com.stevesoft.pat.oneChar (sp.c));
+} else {
+this.addMulti (i1, i2);
+}} else if (sp.escMatch ('x') && this.next2Hex (sp)) {
+sp.inc ();
+var d = this.getHexDigit (sp);
+sp.inc ();
+d = 16 * d + this.getHexDigit (sp);
+this.add ( new com.stevesoft.pat.oneChar (String.fromCharCode (d)));
+} else if (sp.escMatch ('c')) {
+sp.inc ();
+if (sp.c.charCodeAt (0) < com.stevesoft.pat.Ctrl.cmap.length) {
+this.add ( new com.stevesoft.pat.oneChar (com.stevesoft.pat.Ctrl.cmap[sp.c.charCodeAt (0)]));
+} else {
+this.add ( new com.stevesoft.pat.oneChar (sp.c));
+}} else if (sp.escMatch ('f')) {
+this.add ( new com.stevesoft.pat.oneChar (String.fromCharCode (12)));
+} else if (sp.escMatch ('a')) {
+this.add ( new com.stevesoft.pat.oneChar (String.fromCharCode (7)));
+} else if (sp.escMatch ('t')) {
+this.add ( new com.stevesoft.pat.oneChar ('\t'));
+} else if (sp.escMatch ('n')) {
+this.add ( new com.stevesoft.pat.oneChar ('\n'));
+} else if (sp.escMatch ('r')) {
+this.add ( new com.stevesoft.pat.oneChar ('\r'));
+} else if (sp.escMatch ('b')) {
+this.add ( new com.stevesoft.pat.oneChar ('\b'));
+} else if (sp.escMatch ('e')) {
+this.add ( new com.stevesoft.pat.oneChar (String.fromCharCode (27)));
+} else {
+this.add ( new com.stevesoft.pat.oneChar (sp.c));
+if (sp.match (')')) {
+com.stevesoft.pat.RegSyntaxError.endItAll ("Unmatched right paren in pattern");
+}}}, "com.stevesoft.pat.StrPos,com.stevesoft.pat.Rthings");
+Clazz.defineMethod (c$, "_compile", 
+($fz = function (pat, mk) {
+this.minMatch = null;
+this.sFlag = this.mFlag = this.ignoreCase = this.gFlag = false;
+var sp =  new com.stevesoft.pat.StrPos (pat, 0);
+this.thePattern = this._compileSP (sp, mk);
+this.pt.marks = null;
+return this.thePattern;
+}, $fz.isPrivate = true, $fz), "~S,com.stevesoft.pat.Rthings");
+Clazz.defineMethod (c$, "_compileSP", 
+function (sp, mk) {
+while (!(sp.$eos || (this.or != null && sp.match (')')))) {
+this.compileSP (sp, mk);
+sp.inc ();
+}
+if (sp.match (')')) {
+mk.parenLevel--;
+} else if (sp.$eos && mk.parenLevel != 0) {
+com.stevesoft.pat.RegSyntaxError.endItAll ("Unclosed Parenthesis! lvl=" + mk.parenLevel);
+}if (this.or != null) {
+if (this.p == null) {
+this.p =  new com.stevesoft.pat.NullPattern ();
+}this.or.addOr (this.p);
+return this.or;
+}return this.p == null ?  new com.stevesoft.pat.NullPattern () : this.p;
+}, "com.stevesoft.pat.StrPos,com.stevesoft.pat.Rthings");
+Clazz.defineMethod (c$, "addMulti", 
+function (i1, i2) {
+var last;
+var last2;
+for (last = this.p; last != null && last.next != null; last = last.next) {
+;}
+if (last == null || last === this.p) {
+last2 = null;
+} else {
+for (last2 = this.p; last2.next !== last; last2 = last2.next) {
+;}
+}if (Clazz.instanceOf (last, com.stevesoft.pat.Multi) && i1.intValue () == 0 && i2.intValue () == 1) {
+(last).matchFewest = true;
+} else if (Clazz.instanceOf (last, com.stevesoft.pat.FastMulti) && i1.intValue () == 0 && i2.intValue () == 1) {
+(last).matchFewest = true;
+} else if (Clazz.instanceOf (last, com.stevesoft.pat.DotMulti) && i1.intValue () == 0 && i2.intValue () == 1) {
+(last).matchFewest = true;
+} else if (Clazz.instanceOf (last, com.stevesoft.pat.Multi) || Clazz.instanceOf (last, com.stevesoft.pat.DotMulti) || Clazz.instanceOf (last, com.stevesoft.pat.FastMulti)) {
+throw  new com.stevesoft.pat.RegSyntax ("Syntax error.");
+} else if (last2 == null) {
+this.p = com.stevesoft.pat.Regex.mkMulti (i1, i2, this.p);
+} else {
+last2.next = com.stevesoft.pat.Regex.mkMulti (i1, i2, last);
+}}, "com.stevesoft.pat.patInt,com.stevesoft.pat.patInt");
+c$.mkMulti = Clazz.defineMethod (c$, "mkMulti", 
+function (lo, hi, p) {
+if (Clazz.instanceOf (p, com.stevesoft.pat.Any) && p.next == null) {
+return  new com.stevesoft.pat.DotMulti (lo, hi);
+}return com.stevesoft.pat.RegOpt.safe4fm (p) ?  new com.stevesoft.pat.FastMulti (lo, hi, p) :  new com.stevesoft.pat.Multi (lo, hi, p);
+}, "com.stevesoft.pat.patInt,com.stevesoft.pat.patInt,com.stevesoft.pat.Pattern");
+Clazz.defineMethod (c$, "matchBracket", 
+function (sp) {
+var ret;
+if (sp.match ('^')) {
+ret =  new com.stevesoft.pat.Bracket (true);
+sp.inc ();
+} else {
+ret =  new com.stevesoft.pat.Bracket (false);
+}if (sp.match (']')) {
+com.stevesoft.pat.RegSyntaxError.endItAll ("Unmatched []");
+}while (!sp.$eos && !sp.match (']')) {
+var s1 =  new com.stevesoft.pat.StrPos (sp);
+s1.inc ();
+var s1_ =  new com.stevesoft.pat.StrPos (s1);
+s1_.inc ();
+if (s1.match ('-') && !s1_.match (']')) {
+var s2 =  new com.stevesoft.pat.StrPos (s1);
+s2.inc ();
+if (!s2.$eos) {
+ret.addOr ( new com.stevesoft.pat.Range (sp.c, s2.c));
+}sp.inc ();
+sp.inc ();
+} else if (sp.escMatch ('Q')) {
+sp.inc ();
+while (!sp.escMatch ('E')) {
+ret.addOr ( new com.stevesoft.pat.oneChar (sp.c));
+sp.inc ();
+}
+} else if (sp.escMatch ('d')) {
+ret.addOr ( new com.stevesoft.pat.Range ('0', '9'));
+} else if (sp.escMatch ('s')) {
+ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (32)));
+ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (8), String.fromCharCode (10)));
+ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (13)));
+} else if (sp.escMatch ('w')) {
+ret.addOr ( new com.stevesoft.pat.Range ('a', 'z'));
+ret.addOr ( new com.stevesoft.pat.Range ('A', 'Z'));
+ret.addOr ( new com.stevesoft.pat.Range ('0', '9'));
+ret.addOr ( new com.stevesoft.pat.oneChar ('_'));
+} else if (sp.escMatch ('D')) {
+ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (0), String.fromCharCode (47)));
+ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (58), String.fromCharCode (65535)));
+} else if (sp.escMatch ('S')) {
+ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (0), String.fromCharCode (7)));
+ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (11), String.fromCharCode (12)));
+ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (14), String.fromCharCode (31)));
+ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (33), String.fromCharCode (65535)));
+} else if (sp.escMatch ('W')) {
+ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (0), String.fromCharCode (64)));
+ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (91), String.fromCharCode (94)));
+ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (96)));
+ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (123), String.fromCharCode (65535)));
+} else if (sp.escMatch ('x') && this.next2Hex (sp)) {
+sp.inc ();
+var d = this.getHexDigit (sp);
+sp.inc ();
+d = 16 * d + this.getHexDigit (sp);
+ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (d)));
+} else if (sp.escMatch ('a')) {
+ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (7)));
+} else if (sp.escMatch ('f')) {
+ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (12)));
+} else if (sp.escMatch ('e')) {
+ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (27)));
+} else if (sp.escMatch ('n')) {
+ret.addOr ( new com.stevesoft.pat.oneChar ('\n'));
+} else if (sp.escMatch ('t')) {
+ret.addOr ( new com.stevesoft.pat.oneChar ('\t'));
+} else if (sp.escMatch ('r')) {
+ret.addOr ( new com.stevesoft.pat.oneChar ('\r'));
+} else if (sp.escMatch ('c')) {
+sp.inc ();
+if (sp.c.charCodeAt (0) < com.stevesoft.pat.Ctrl.cmap.length) {
+ret.addOr ( new com.stevesoft.pat.oneChar (com.stevesoft.pat.Ctrl.cmap[sp.c.charCodeAt (0)]));
+} else {
+ret.addOr ( new com.stevesoft.pat.oneChar (sp.c));
+}} else if (this.isOctalString (sp)) {
+var d = sp.c.charCodeAt (0) - 48;
+sp.inc ();
+d = 8 * d + sp.c.charCodeAt (0) - 48;
+var sp2 =  new com.stevesoft.pat.StrPos (sp);
+sp2.inc ();
+if (this.isOctalDigit (sp2, false)) {
+sp.inc ();
+d = 8 * d + sp.c.charCodeAt (0) - 48;
+}ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (d)));
+} else {
+ret.addOr ( new com.stevesoft.pat.oneChar (sp.c));
+}sp.inc ();
+}
+return ret;
+}, "com.stevesoft.pat.StrPos");
+Clazz.overrideMethod (c$, "toString", 
+function () {
+{
+var sb =  new StringBuffer ();
+if (this.esc != '\\') {
+sb.append ("(?e=");
+sb.append (this.esc);
+sb.append (")");
+}if (this.gFlag || this.mFlag || !com.stevesoft.pat.Regex.dotDoesntMatchCR || this.sFlag || this.ignoreCase || this.dontMatchInQuotes || this.optimized ()) {
+sb.append ("(?");
+if (this.ignoreCase) {
+sb.append ("i");
+}if (this.mFlag) {
+sb.append ("m");
+}if (this.sFlag || !com.stevesoft.pat.Regex.dotDoesntMatchCR) {
+sb.append ("s");
+}if (this.dontMatchInQuotes) {
+sb.append ("Q");
+}if (this.optimized ()) {
+sb.append ("o");
+}if (this.gFlag) {
+sb.append ("g");
+}sb.append (")");
+}var patstr = this.thePattern.toString ();
+if (this.esc != '\\') {
+patstr = com.stevesoft.pat.Regex.reEscape (patstr, '\\', this.esc);
+}sb.append (patstr);
+return sb.toString ();
+}});
+c$.reEscape = Clazz.defineMethod (c$, "reEscape", 
+function (s, oldEsc, newEsc) {
+if (oldEsc == newEsc) {
+return s;
+}var i;
+var sb =  new StringBuffer ();
+for (i = 0; i < s.length; i++) {
+if (s.charAt (i) == oldEsc && i + 1 < s.length) {
+if (s.charAt (i + 1) == oldEsc) {
+sb.append (oldEsc);
+} else {
+sb.append (newEsc);
+sb.append (s.charAt (i + 1));
+}i++;
+} else if (s.charAt (i) == newEsc) {
+sb.append (newEsc);
+sb.append (newEsc);
+} else {
+sb.append (s.charAt (i));
+}}
+return sb.toString ();
+}, "~S,~S,~S");
+Clazz.defineMethod (c$, "accept", 
+function (dir, s) {
+return this.search (s);
+}, "java.io.File,~S");
+c$.version = Clazz.defineMethod (c$, "version", 
+function () {
+return "lgpl release 1.5.3";
+});
+Clazz.defineMethod (c$, "optimize", 
+function () {
+if (this.optimized () || this.thePattern == null) {
+return;
+}this.minMatch =  new com.stevesoft.pat.patInt (0);
+this.thePattern = com.stevesoft.pat.RegOpt.opt (this.thePattern, this.ignoreCase, this.dontMatchInQuotes);
+this.skipper = com.stevesoft.pat.Skip.findSkipRegex (this);
+return;
+});
+Clazz.defineMethod (c$, "optimized", 
+function () {
+return this.minMatch != null;
+});
+c$.perlCode = Clazz.defineMethod (c$, "perlCode", 
+function (s) {
+return com.stevesoft.pat.parsePerl.parse (s);
+}, "~S");
+Clazz.defineMethod (c$, "isLiteral", 
+function () {
+var x = this.thePattern;
+while (x != null) {
+if (Clazz.instanceOf (x, com.stevesoft.pat.oneChar)) {
+;} else if (Clazz.instanceOf (x, com.stevesoft.pat.Skipped)) {
+;} else {
+return false;
+}x = x.next;
+}
+return true;
+});
+Clazz.defineMethod (c$, "countMinChars", 
+function () {
+return this.thePattern.countMinChars ();
+});
+Clazz.defineMethod (c$, "countMaxChars", 
+function () {
+return this.thePattern.countMaxChars ();
+});
+Clazz.defineMethod (c$, "isHexDigit", 
+function (sp) {
+var r = !sp.$eos && !sp.dontMatch && ((sp.c >= '0' && sp.c <= '9') || (sp.c >= 'a' && sp.c <= 'f') || (sp.c >= 'A' && sp.c <= 'F'));
+return r;
+}, "com.stevesoft.pat.StrPos");
+Clazz.defineMethod (c$, "isOctalDigit", 
+function (sp, first) {
+var r = !sp.$eos && !( new Boolean (first ^ sp.dontMatch).valueOf ()) && sp.c >= '0' && sp.c <= '7';
+return r;
+}, "com.stevesoft.pat.StrPos,~B");
+Clazz.defineMethod (c$, "getHexDigit", 
+function (sp) {
+if (sp.c >= '0' && sp.c <= '9') {
+return sp.c.charCodeAt (0) - 48;
+}if (sp.c >= 'a' && sp.c <= 'f') {
+return sp.c.charCodeAt (0) - 97 + 10;
+}return sp.c.charCodeAt (0) - 65 + 10;
+}, "com.stevesoft.pat.StrPos");
+Clazz.defineMethod (c$, "next2Hex", 
+function (sp) {
+var sp2 =  new com.stevesoft.pat.StrPos (sp);
+sp2.inc ();
+if (!this.isHexDigit (sp2)) {
+return false;
+}sp2.inc ();
+if (!this.isHexDigit (sp2)) {
+return false;
+}return true;
+}, "com.stevesoft.pat.StrPos");
+Clazz.defineMethod (c$, "isOctalString", 
+function (sp) {
+if (!this.isOctalDigit (sp, true)) {
+return false;
+}var sp2 =  new com.stevesoft.pat.StrPos (sp);
+sp2.inc ();
+if (!this.isOctalDigit (sp2, false)) {
+return false;
+}return true;
+}, "com.stevesoft.pat.StrPos");
+Clazz.defineStatics (c$,
+"BackRefOffset", 1);
+c$.none = c$.prototype.none =  new com.stevesoft.pat.NoPattern ();
+c$.validators = c$.prototype.validators =  new java.util.Hashtable ();
+{
+com.stevesoft.pat.Regex.defineV ("p", "(?>1)",  new com.stevesoft.pat.UnicodePunct ());
+com.stevesoft.pat.Regex.defineV ("P", "(?>1)",  new com.stevesoft.pat.NUnicodePunct ());
+com.stevesoft.pat.Regex.defineV ("s", "(?>1)",  new com.stevesoft.pat.UnicodeWhite ());
+com.stevesoft.pat.Regex.defineV ("S", "(?>1)",  new com.stevesoft.pat.NUnicodeWhite ());
+com.stevesoft.pat.Regex.defineV ("w", "(?>1)",  new com.stevesoft.pat.UnicodeW ());
+com.stevesoft.pat.Regex.defineV ("W", "(?>1)",  new com.stevesoft.pat.NUnicodeW ());
+com.stevesoft.pat.Regex.defineV ("d", "(?>1)",  new com.stevesoft.pat.UnicodeDigit ());
+com.stevesoft.pat.Regex.defineV ("D", "(?>1)",  new com.stevesoft.pat.NUnicodeDigit ());
+com.stevesoft.pat.Regex.defineV ("m", "(?>1)",  new com.stevesoft.pat.UnicodeMath ());
+com.stevesoft.pat.Regex.defineV ("M", "(?>1)",  new com.stevesoft.pat.NUnicodeMath ());
+com.stevesoft.pat.Regex.defineV ("c", "(?>1)",  new com.stevesoft.pat.UnicodeCurrency ());
+com.stevesoft.pat.Regex.defineV ("C", "(?>1)",  new com.stevesoft.pat.NUnicodeCurrency ());
+com.stevesoft.pat.Regex.defineV ("a", "(?>1)",  new com.stevesoft.pat.UnicodeAlpha ());
+com.stevesoft.pat.Regex.defineV ("A", "(?>1)",  new com.stevesoft.pat.NUnicodeAlpha ());
+com.stevesoft.pat.Regex.defineV ("uc", "(?>1)",  new com.stevesoft.pat.UnicodeUpper ());
+com.stevesoft.pat.Regex.defineV ("lc", "(?>1)",  new com.stevesoft.pat.UnicodeLower ());
+}Clazz.defineStatics (c$,
+"defaultMFlag", false,
+"dotDoesntMatchCR", true,
+"lasts", null,
+"lastbs", null,
+"back_slash", '\\');
+});