Input:
blablabla #ff00ff blablabla #11aacc blablabla blablabla #ff00ff blablabla #11aacc blablabla blablabla #ff00ff blablabla #11aacc blablabla blablabla #ff00ff blablabla #11aacc blablabla blablabla #ff00ff blablabla #11aacc blablabla blablabla #ff00ff blablabla #11aacc blablabla blablabla #ff00ff blablabla #11aacc blablabla
Search_Pattern:
#(..)(..)(..)
Replace_Pattern:
return "rgb("+ parseInt($1,16) +", "+ parseInt($2,16) +", "+ parseInt($3,16) +")"
is a function:
with arguments:
Controls:
Flags:
RX_ON:
Loop:
The function (double-click to reload ['re-eval']):
function regplax() { var form = document.forms[0]; var input = form.Input; var output = input; var pattern = form.Search_Pattern.value; if ( !form.RX_ON.checked ) { pattern = pattern.replace(/(\W)/g,'\\$1') } var Flags = form.Flags.value; var searchRg = new RegExp(pattern,Flags); if ( form.ptrn_is_fnc.checked ) { var replaceSt = eval ( "new Function(\"" + form.ptrn_is_fnc_params.value.split(/,\s*/).join("\",\"") + "\",\"" + form.Replace_Pattern.value.replace(/(")/g,'\\$1') + "\")" ); } else { var replaceSt = form.Replace_Pattern.value; } var buff = input.value.replace(searchRg,replaceSt); if ( form.loop.checked ) { while( buff.search(searchRg) > -1 ) { buff = buff.replace(searchRg,replaceSt); } } output.value = buff; } window.regplax = regplax;