Add utility regexp split function for non-whitespace words

This commit is contained in:
BrokenEagle
2020-03-07 06:10:50 +00:00
parent d1aed303fd
commit 161e776cf7
4 changed files with 15 additions and 14 deletions

View File

@@ -108,6 +108,10 @@ Utility.regexp_escape = function(string) {
return string.replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
}
Utility.regexp_split = function(string) {
return [...new Set(String(string === null || string === undefined ? "" : string).match(/\S+/g))];
}
$.fn.selectEnd = function() {
return this.each(function() {
this.focus();