in reply to Regex exact pattern match problem!
The documentation notes that the global replace is not progressive like the match operator (in scalar context). That is only applicable to successive calls to the operators, not for the completion of a single call.#!/usr/bin/perl use strict; use warnings; my $toTranslate = "333333333333333333333333333333333333333333333333333 +333333333333333333333333333333333333333333333333333333333333333333233 +333333322333333333233333333333333333333333333333333323333333322333333 +332333333333"; $toTranslate =~ s/((?:3{4})+)/"[" . length($1) . "]"/ge; print $toTranslate,"\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex exact pattern match problem!
by johngg (Canon) on Nov 20, 2008 at 23:16 UTC | |
by JadeNB (Chaplain) on Nov 21, 2008 at 00:16 UTC | |
by johngg (Canon) on Nov 21, 2008 at 13:19 UTC |