Jts has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/str/perl -w use strict; use warnings; my $toTranslate ="3333333333333333333333333333333333333333333333333333 +333333333333333333333333333333333333333333333333333333333333333332333 +333333223333333332333333333333333333333333333333333233333333223333333 +32333333333"; my $tmpFound; my $count = 0; while($toTranslate =~ /(3{4,})+/g) { $tmpFound = $1; $tmpFound = length($tmpFound); $toTranslate =~ s/$1/[$tmpFound]/; } print $toTranslate,"\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex exact pattern match problem!
by moritz (Cardinal) on Nov 20, 2008 at 16:55 UTC | |
by AnomalousMonk (Archbishop) on Nov 20, 2008 at 20:10 UTC | |
|
Re: Regex exact pattern match problem!
by JadeNB (Chaplain) on Nov 20, 2008 at 17:18 UTC | |
|
Re: Regex exact pattern match problem!
by eye (Chaplain) on Nov 20, 2008 at 19:52 UTC | |
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 | |
|
Re: Regex exact pattern match problem!
by CountZero (Bishop) on Nov 20, 2008 at 19:40 UTC | |
by Jts (Initiate) on Nov 24, 2008 at 08:05 UTC |