in reply to Re: simplifying substitution
in thread simplifying substitution
Maybe my perl version is different, but I can never get away with using actual spaces like that on the match side--I'd have to represent them...something like this:
$all =~ s/([ ]{2}[1-9][0-9])[ ]/$1\t\t/g;If running strictly on English and there were no possibilities or no issue with encountering numbers like '04' which had to be handled differently, the code could be a mite simpler:
$all =~ s/([ ]{2}\d\d)[ ]/$1\t\t/g;Blessings,
~Polyglot~
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: simplifying substitution
by choroba (Cardinal) on Mar 08, 2021 at 13:06 UTC | |
by Polyglot (Chaplain) on Mar 08, 2021 at 14:18 UTC | |
by choroba (Cardinal) on Mar 08, 2021 at 14:23 UTC | |
by Polyglot (Chaplain) on Mar 08, 2021 at 14:50 UTC | |
by choroba (Cardinal) on Mar 08, 2021 at 14:52 UTC | |
| |
|
Re^3: simplifying substitution
by Konabob (Initiate) on Mar 08, 2021 at 15:36 UTC |