On Jul 27, John W. Krahn said: >> No, $1 is either "&" or undef. Perhaps you want: >> >> s[([&<>])|\\($rx)][<$rep{$+}/>]go; >> >> That $+ means "the last () that matched". But that still replaces & with >> <&/>. So you'd need to make the '<' and '/>' part of the %rep hash's >> values. I would suggest: > >I thought '<' and '/>' were already in the hash values? If so, wouldn't >this work?
They could be, sure, but he didn't seem to have done it, which is why I then modified it to assume that. > s[([&<>]|(?<=\\)$rx)][$rep{$1}]go; That doesn't remove the \ from the string, though. -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ ** Look for "Regular Expressions in Perl" published by Manning, in 2002 ** <stu> what does y/// stand for? <tenderpuss> why, yansliterate of course. [ I'm looking for programming work. If you like my work, let me know. ] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]