I want to replace some characters in string e.g.
console.log(
"truefalse".replace("e","E")
)
but using jsfuck convenction where only 6 chars are allowed: []()!+
, here for increase readability also JS strings with letters a-z and A-Z and numbers 0-9 are allowed (because it is easy to convert such strings to 6-char jsf code). So I can write it as follows
console.log(
"truefalse"["replace"]("e","E")
)
but in above code I use forbidden character - comma: ,
. So I use technique of calling function with 2 (and more) paremeters discovered by trincot here as follows
console.log(
"truefalse"["split"]()["concat"]([["e"]["concat"]("E")])
["reduce"](""["replace"]["apply"]["bind"](""["replace"]))
)
Now I want to use regular expression in replace function and write code using above restrictions
console.log(
"truefalse"["replace"](/e/g,"E")
)
but I don't know what to do with regexp part /e/g
?. It is possible to do it without using any kind of 'eval' (where string is interpreted as code)?