foswiki.String={isWikiWord:function(a){if(!a){return false}var b=new RegExp(foswiki.StringConstants.getInstance().WIKIWORD_REGEX);return(a.match(b))?true:false},capitalize:function(a){if(!a){return null}var b=new RegExp("["+foswiki.StringConstants.getInstance().MIXED_ALPHANUM_CHARS+"]+","g");return a.replace(b,function(c){return c.charAt(0).toLocaleUpperCase()+c.substr(1)})},isBoolean:function(a){return(a=="on")||(a=="true")||(a=="1")},removeSpaces:function(a){return a.replace(/\s/g,"")},trimSpaces:function(a){if(a){a=a.replace(/^\s\s*/,"")}if(a){a=a.replace(/\s\s*$/,"")}return a},filterPunctuation:function(a){if(!a){return null}var c=foswiki.getPreference("NAMEFILTER");var b=new RegExp(c,"g");return a.replace(b," ")},removePunctuation:function(b){if(!b){return null}var a="[^"+foswiki.StringConstants.getInstance().MIXED_ALPHANUM_CHARS+"]";var c=new RegExp(a,"g");return b.replace(c,"")},makeWikiWord:function(a){if(!a){return null}return foswiki.String.removePunctuation(foswiki.String.capitalize(a))},makeSafeForTableEntry:function(b){if(b.length==0){return""}var a=b;var c;c=new RegExp(/\r/g);a=a.replace(c,"\n");c=new RegExp(/\|/g);a=a.replace(c,"/");c=new RegExp(/\n\s*\n/g);a=a.replace(c,"%<nop>BR%%<nop>BR%");c=new RegExp(/\n/g);a=a.replace(c,"%<nop>BR%");a+=" ";return a}};foswiki.StringConstants=function(){this.init()};foswiki.StringConstants.__instance__=null;foswiki.StringConstants.getInstance=function(){if(this.__instance__==null){this.__instance__=new foswiki.StringConstants()}return this.__instance__};foswiki.StringConstants.prototype.UPPER_ALPHA_CHARS="A-Z";foswiki.StringConstants.prototype.LOWER_ALPHA_CHARS="a-z";foswiki.StringConstants.prototype.NUMERIC_CHARS="\\d";foswiki.StringConstants.prototype.MIXED_ALPHA_CHARS;foswiki.StringConstants.prototype.MIXED_ALPHANUM_CHARS;foswiki.StringConstants.prototype.LOWER_ALPHANUM_CHARS;foswiki.StringConstants.prototype.WIKIWORD_REGEX;foswiki.StringConstants.prototype.ALLOWED_URL_CHARS;foswiki.StringConstants.prototype.init=function(){foswiki.StringConstants.prototype.MIXED_ALPHA_CHARS=foswiki.StringConstants.prototype.LOWER_ALPHA_CHARS+foswiki.StringConstants.prototype.UPPER_ALPHA_CHARS;foswiki.StringConstants.prototype.MIXED_ALPHANUM_CHARS=foswiki.StringConstants.prototype.MIXED_ALPHA_CHARS+foswiki.StringConstants.prototype.NUMERIC_CHARS;foswiki.StringConstants.prototype.LOWER_ALPHANUM_CHARS=foswiki.StringConstants.prototype.LOWER_ALPHA_CHARS+foswiki.StringConstants.prototype.NUMERIC_CHARS;foswiki.StringConstants.prototype.WIKIWORD_REGEX="^["+foswiki.StringConstants.prototype.UPPER_ALPHA_CHARS+"]+["+foswiki.StringConstants.prototype.LOWER_ALPHANUM_CHARS+"]+["+foswiki.StringConstants.prototype.UPPER_ALPHA_CHARS+"]+["+foswiki.StringConstants.prototype.MIXED_ALPHANUM_CHARS+"]*";foswiki.StringConstants.prototype.ALLOWED_URL_CHARS=foswiki.StringConstants.prototype.MIXED_ALPHANUM_CHARS+"-_^"};