[thelist] Regex, dynamic replace and problem with numbers.

Raymond Camden jedimaster at macromedia.com
Tue Mar 12 15:50:01 CST 2002


Yep. Found that out a bit later. :) Perl says, if I understand right,
\123 - Are the 123 backreferences? No, Try \12, are there 12? No, try 1.
It will do this for any backref > 9.

=======================================================================
Raymond Camden, Principal Spectra Compliance Engineer for Macromedia

Email    : jedimaster at macromedia.com
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda

> -----Original Message-----
> From: thelist-admin at lists.evolt.org
> [mailto:thelist-admin at lists.evolt.org] On Behalf Of Plunkett, Matt
> Sent: Tuesday, March 12, 2002 4:15 PM
> To: 'thelist at lists.evolt.org'
> Subject: RE: [thelist] Regex, dynamic replace and problem
> with numbers.
>
>
> You may have hit on a CF specific problem.  I converted your
> code to Perl
> and it works fine:
>
> #!perl -w
>
> use strict;
>
> my $str = "23 Main St";
> my $container_str = "<input type=\"Text\" name=\"Address\"
> value=\"\" />";
>
> $container_str =~ s/([^>]* value="?)([^"\s]*)(["\s>][^>]*>)/$1$str$3/;
>
> print $container_str;
>




More information about the thelist mailing list