in reply to Re: How to split line of text into array containing macros and non-macro text
in thread How to split line of text into array containing macros and non-macro text
Why do I have to hit ENTER to execute the print statement?#!/usr/bin/perl -nl use strict; my($i,$t); $t="<macro1>[tag1]This is plain text.<macro2>More text.[tag2]And more +text."; my @fields=split /((?:<[^>]+>|\[[^]]+])+)/, $t; shift @fields if $fields[0] eq ''; print for @fields; exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to split line of text into array containing macros and non-macro text
by choroba (Cardinal) on Mar 26, 2014 at 10:45 UTC |