Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Regex match last

by Neighbour (Friar)
on Aug 20, 2012 at 11:32 UTC ( #988431=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Regex match last
in thread Regex match last

In that case, you'll want:

#!/usr/bin/perl use strict; use warnings; my $data = '<w:body><w:p w:rsidR="00A654E7" w:rsidRPr="00AD741F" w:rsi +dRDefault="00A654E7" w:rsidP="00A654E7"><w:pPr><w:pStyle w:val="Stand +ard"/><w:rPr><w:rFonts w:asciiTheme="minorHAnsi" w:hAnsiTheme="minorH +Ansi" w:cstheme="minorHAnsi"/><w:sz w:val="20"/><w:szCs w:val="20"/>< +/w:rPr></w:pPr><w:r w:rsidRPr="00AD741F"/></w:body>'; print "Matches found:\n" . join (",\n", $data =~ m@(<[^>]*/>)@g) . "\n +";
Output:
Matches found: <w:pStyle w:val="Standard"/>, <w:rFonts w:asciiTheme="minorHAnsi" w:hAnsiTheme="minorHAnsi" w:csthem +e="minorHAnsi"/>, <w:sz w:val="20"/>, <w:szCs w:val="20"/>, <w:r w:rsidRPr="00AD741F"/>


Comment on Re^3: Regex match last
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://988431]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2015-07-07 10:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (88 votes), past polls