Closed p5pRT closed 21 years ago
=====BEGIN===== If I use regular expression in extended mode (with X modifier)\, Perl insert all whitespaces from replacement part into result string.
Sample: s{ abcd }{ 1234 }x;
Per use patter "abcd" without all whitespaces (\t or \n in sample) and replacement "\n\t1234\n" with all whitespaces from sample.
The unsightly solution is following: s{ abcd }{ "1234" }xe;
Result string is "1234". But\, if I want using replacement on more lines\, this solution is slow (string concatenation) than classic replacement without pattern as an expression.
Thanks\, Tom.
I using Perl under Windows 98 CZ.
=====END=====
Hi\, I'm just going through the Perl bugs database closing old bug reports.
if I use regular expression in extended mode (with X modifier)\, Perl insert all whitespaces from replacement part into result string.
Sample: s{ abcd }{ 1234 }x;
This is the intended behaviour. the /x modifier applies only to the pattern string\, not the replacement string. Even if we wanted to change it we couldn't\, because it would break many existing scripts.
Regards\,
Dave M.
@iabyn - Status changed from 'open' to 'resolved'
Migrated from rt.perl.org#2470 (status was 'resolved')
Searchable as RT2470$