inblosam has asked for the wisdom of the Perl Monks concerning the following question:
<blank title="Title of My Page">
#text is put in an array called page_text foreach my $new_line(@page_text) { #put each line into another array my @blankPages = ($new_line =~ m/<blank[^>]+?title\s*=\s*["']? +([^'" >]+?)[ '"]?>/sig); foreach my $blankTitle(@blankPages) { print "$blankTitle is the title\n"; #do some logic to add a blank page with that title } }
Your help would be much appreciated!if ($new_line =! m/sameregexasabove?/sig) { #don't write a new line with the xml tag, but any other text is + okay }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex and a pseudo-XML tag
by Abigail-II (Bishop) on Nov 20, 2003 at 15:17 UTC | |
by inblosam (Monk) on Nov 20, 2003 at 16:27 UTC | |
by CountZero (Bishop) on Nov 20, 2003 at 20:31 UTC | |
by inblosam (Monk) on Nov 21, 2003 at 03:11 UTC | |
|
Re: Regex and a pseudo-XML tag
by Roy Johnson (Monsignor) on Nov 20, 2003 at 15:22 UTC | |
by graff (Chancellor) on Nov 21, 2003 at 03:28 UTC |