foxreplace
foxreplace copied to clipboard
enable regex output to be string or function
regex nativly supports the feature to use a string or a function it would be cool if we could use this inside foxreplace
a simple sample:
var re = /(\b[a-z](?!\s))/g;
var s = "this is a sample text to camelcase this text!";
s1 = s.replace(re, function(x){return x.toUpperCase();});
//or if multiple capture groups something like this
s2 = s.replace(re, function(...x){x.string=x.pop(); x.index=x.pop(); return x[1].toUpperCase();});