Got the regex (?<!a|\d)[0-9]{6,} to match any digits with 6 in length or more, but that do not start with \ or digits.
Previously, I used I used [0-9] in replace("[0-9]", "x"), and it would replace 111 with xxx.
But now with the new formula replace("(?<!a|\d)[0-9]{6,}", "x") it just replaces with one x.
How can I make it so it continues the old behavior? I tried to use a function but it did not seem to work very well (using Zoho mail which uses weird JS language)
Use a function as the replacement. It can then repeat the character the same number of times as the length of the match.
console.log('123456'.replace(/(?<!a|\d)[0-9]{6,}/g, match => "x".repeat(match.length)));