APM: replacing tab separated blanks

david slimp rock808 at DavidSlimp.com
Wed Dec 4 12:32:24 CST 2002


On Wed, Dec 04, 2002 at 01:16:43PM -0500, Mike Stok wrote:
> On Wed, 4 Dec 2002, Tom.Bakken wrote:
> > I want to replace the following:
> > TabTabTabTab
> > with:
> > Tab0Tab0TAb0

	Is there some reason you are just not doing this?

	s/\t/\t0/g 



david



> Enter h or `h h' for help, or `man perldebug' for more help.
> 
> main::(-e:1):   1
>   DB<1> $s = 'TabTabTabTab'
> 
>   DB<2> $s =~ s/(Tab)(?=Tab)/${1}0/g
> 
>   DB<3> print $s
> Tab0Tab0Tab0Tab
>   DB<4> 
> 
> But I still have an extra 'Tab' on the end - your desired result was 
> Tab0Tab0Tab0.  If you want to get rid of that then you could just
> 
>   s/Tab$//;
> 
> afterwards.
> 
> Hope this helps,
> 
> Mike
> 
> -- 
> mike at stok.co.uk                    |           The "`Stok' disclaimers" apply.
> http://www.stok.co.uk/~mike/       | GPG PGP Key      1024D/059913DA 
> mike at exegenix.com                  | Fingerprint      0570 71CD 6790 7C28 3D60
> http://www.exegenix.com/           |                  75D2 9EC4 C1C0 0599 13DA
> 
> _______________________________________________
> Austin mailing list
> Austin at mail.pm.org
> http://mail.pm.org/mailman/listinfo/austin

-- 
David Slimp
rock808 at DavidSlimp.com
http://www.DavidSlimp.com
Yahoo Instant Messenger ID:  rock808



More information about the Austin mailing list