wip escape chars
This commit is contained in:
@@ -19,7 +19,26 @@ export class ChatController {
|
|||||||
private chatGateway: ChatGateway,
|
private chatGateway: ChatGateway,
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
this.allowed_chars = "#!?-_";
|
this.allowed_chars = '-#!?_';
|
||||||
|
/*
|
||||||
|
let text = "The best things in life are-* free";
|
||||||
|
|
||||||
|
function escape_chars(str)
|
||||||
|
{
|
||||||
|
return new_str = str.split("").join("\\");
|
||||||
|
}
|
||||||
|
|
||||||
|
let allowed_chars = '#!?\\-_';
|
||||||
|
let regex_base = `[a-zA-Z0-9\\s${allowed_chars}]`;
|
||||||
|
let test_regex = new RegExp(`^${regex_base}+$`);
|
||||||
|
|
||||||
|
let result = "";
|
||||||
|
result = escape_chars(allowed_chars);
|
||||||
|
//if (test_regex.test(text) === false)
|
||||||
|
// result = text.replace(new RegExp(regex_base, "g"), "");
|
||||||
|
|
||||||
|
document.getElementById("demo").innerHTML = "[" + result + "]";
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user