in reply to Re: Splitting string based on potentially escaped character
in thread Splitting string based on potentially escaped character
perl -wMstrict -MData::Dump -leCode:
Yieldsmy $string = 'fooXbarXbazXboff'; my $separator = 'X'; my $replace = '<REPLACE>'; $string =~ s{ \Q$separator\E }{$replace}xmsg; dd $string;
foo<REPLACE>bar<REPLACE>baz<REPLACE>boffSo much more useful for the OP and no additional effort on your behalf.
|
|---|