On Wed, 22 Jan 2003 02:46:27 +0800, Justino Berrun wrote: > #hello, is there a way to split a string between a digit and character > #without losing the digit or the character > #Any help would be very appreciated > > $string='hello...4546perl.......2366Pogrammers..3435'; #e.g. would make three new >strings > > @newstrings=split(/(\d)([a-zA-Z])/,$string); #<--- no success here
use the look-ahead and look-behind features of regexes: split /(?<=\d)(?=[a-zA-Z])/, $string Greetings, Janek -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]