Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Unable to constrain the effect of a negative lookahead

by tybalt89 (Monsignor)
on Apr 14, 2022 at 18:21 UTC ( [id://11142988]=note: print w/replies, xml ) Need Help??


in reply to Unable to constrain the effect of a negative lookahead

#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11142984 use warnings; $_ = <<END; run_type = dev, max_monitor_time = 0.25 verbosity_level = 2 batch = ( source = sample_document_collection_1 files = Confucius.docx dest = Enterprise:Department ) END my @want = grep defined, /\bbatch =/ && # there is a 'batch =' /^(?:\h*batch\s+=[\s\S]*\z # skip rest of string | \h*(.*=.*?),?\h*\n) # the pattern we want /gmx; use Data::Dump 'dd'; dd \@want;

Outputs:

[ "run_type = dev", "max_monitor_time = 0.25", "verbosity_level = 2", ]

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2024-04-25 08:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found