wip escape chars

This commit is contained in:
simplonco
2023-01-10 11:17:05 +01:00
parent 0f8cca33bf
commit 2e67d3ce6f

View File

@@ -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 + "]";
*/
} }