in reply to Re^3: Delete a string possibly over two lines
in thread Delete a string possibly over two lines
I'm new to perl so I may have made a mistake. Here are two examples of the strings I want to delete
{ Programa 1.2.3 64-bit 2dat: }
{ Programb 10.1.2.3 64-bit 1dat: }
Also sometimes there are no spaces between the braces like {Programa 1.2.3 64-bit 2dat:}, { Programa 1.2.3 64-bit 2dat:} and {Programa 1.2.3 64-bit 2dat: }. Does this make a difference to the code?
It would be good to get rid of both strings in one script. I'm using Perl version 5.24.1.
Update: After doing some reading, I have now tried s/.*\K\{\s*Name.*\}//s; and that seems to work with spaces/no spaces with the {}. I still don't know how to use one script to remove two or more strings like { Programa 1.2.3 64-bit 2dat: } and { Programb 10.1.2.3 64-bit 1dat: }.
Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Delete a string possibly over two lines
by tybalt89 (Monsignor) on Feb 06, 2018 at 09:54 UTC | |
by texuser (Novice) on Feb 07, 2018 at 02:57 UTC | |
by AnomalousMonk (Archbishop) on Feb 07, 2018 at 03:32 UTC | |
by texuser (Novice) on Feb 07, 2018 at 05:01 UTC |