mchampag has asked for the wisdom of the Perl Monks concerning the following question:
UPDATE: Solved! Thanks, BioLion!
Brothers and sisters, I have slurped into a multiline scalar named $tocfile the following text, which I want to mangle:
CD_DA CD_TEXT { LANGUAGE_MAP { 0: 9 } LANGUAGE 0 { TITLE "Multi-01" PERFORMER "" SIZE_INFO { 1, 1, 19, 0, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 7, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0} } } // Track 1
I want to keep the first and last lines with two newlines between them, and I want to delete the section beginning "CD_TEXT". Here's my regex:
$tocfile =~ s/CD_TEXT.+(\/\/ Track)/$1/m;With it, I'm trying to replace everything starting with 'CD_TEXT' to '// Track" with '// Track', but it isn't working. Can someone please illuminate me as to why it is not, or suggest an alternate approach?
Humble thanks,
Matt
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: regex help, please
by BioLion (Curate) on Dec 21, 2009 at 17:24 UTC | |
by mchampag (Acolyte) on Dec 21, 2009 at 17:52 UTC | |
|
Re: regex help, please
by Marshall (Canon) on Dec 21, 2009 at 17:33 UTC | |
by mchampag (Acolyte) on Dec 21, 2009 at 18:18 UTC | |
|
Re: regex help, please
by shmem (Chancellor) on Dec 21, 2009 at 17:45 UTC | |
|
Re: regex help, please
by johngg (Canon) on Dec 21, 2009 at 20:25 UTC | |
|
Re: regex help, please
by SuicideJunkie (Vicar) on Dec 21, 2009 at 17:03 UTC | |
by mchampag (Acolyte) on Dec 21, 2009 at 17:18 UTC |