That's some hot Regex.
On Thu, Jul 11, 2013 at 11:11 AM, Rawdyn Nutting <[email protected]> wrote: > I think you might find a RegEx using back-referencing and look-ahead is > the way to go... > > REReplace(variables.start_str,**'(..)(?!$)','\1:','all'); > > Full test below. > > <cfscript> > variables.start_str = '1Z0617756740260660'; > variables.end_str = REReplace(variables.start_str,**'(..)(?!$)','\1:','all > '); > writeOutput(variables.start_**str & '<br>'); // Initial String > writeOutput('1Z:06:17:75:67:**40:26:06:60<br>'); // Target result > writeOutput(variables.end_str)**; // Actual Result > abort; > </cfscript> > > Rawdy > > -- E: [email protected] T: http://www.twitter.com/neurotic W: www.compoundtheory.com 2 Devs from Down Under Podcast http://www.2ddu.com/ -- You received this message because you are subscribed to the Google Groups "cfaussie" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/cfaussie. For more options, visit https://groups.google.com/groups/opt_out.
