Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Extract delimited words from string

by tybalt89 (Monsignor)
on Dec 08, 2022 at 22:21 UTC ( [id://11148674]=note: print w/replies, xml ) Need Help??


in reply to Extract delimited words from string

#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11148600 use warnings; my @lines = split /\n/, <<END; 50 0 "R0 G255 B0 A255" "Solid" 118 1 "R0 G0 B0 A255" "R0 G0 B0 A255" 0 70 0 "R0 G255 B255 A255" "Solid" 118 1 "R12 G12 B12 A255" "R12 G12 B12 + A255" 0 END my @strings = map /"(.*?)"/g, @lines; print "$_\n" for @strings;

Outputs:

R0 G255 B0 A255 Solid R0 G0 B0 A255 R0 G0 B0 A255 R0 G255 B255 A255 Solid R12 G12 B12 A255 R12 G12 B12 A255

Log In?
Username:
Password:

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

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

    No recent polls found