home *** CD-ROM | disk | FTP | other *** search
- //Has Special Chars
- // + returns true if it only
- // + contains allowed chars
- function switchproxy_allowedChars(str){
- var regex = new RegExp("[\\s\\.a-zA-Z0-9_]", "g");
- return regex.test(str);
- }
-
- // Used to test strings
- // + converts space to underscore
- // + and converts to lowercase
- function switchproxy_simplify(str){
- str = str.replace(new RegExp("\\s{2,}", "g"), " ");
- str = str.replace(new RegExp("\\s", "g"), "_");
- str = str.toLowerCase();
- return str;
- }