Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: How to enforce match priority irrespective of string position

by tybalt89 (Monsignor)
on Mar 08, 2021 at 00:49 UTC ( [id://11129304]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    
    ...
    push @parts, $& while / (Point\s[\d.]+:) .*? (?=Point|\z) (?!\1) /gsx;
    
    use Data::Dump 'dd'; dd \@parts;
    
  2. or download this
    [
      "Point 1.3.4: A piece of text.\n\n",
    ...
      "Point 1.3.6: Another piece of text. Point 1.3.6: For some reason th
    +is piece of text isn't finished yet.\n\nPoint 1.3.6: In fact, this pi
    +ece of text even broke into a new line.\n\n",
      "Point 1.3.7: Finally, a new piece of text.\n\n",
    ]
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-24 03:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found