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

Regex capturing either quoted strings or bare words

by gmax (Abbot)
on Jan 13, 2003 at 17:35 UTC ( [id://226531]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @all_keywords = (qw(one two three ));
    my @mandatory_keywords = (qw(two three ));
    ...
    three = 'name="O\'Hara"'
    ONE="xyz\t"
    END
    
  2. or download this
    my %statement = (
        one => 'xyz\t',
        two => 'a_34',
        three => q{name="O\'Hara"},
    );
    
  3. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
    three    -> <name="O\'Hara" two=a_34>
    four     -> <'one' two>
    five     -> <ah!>
    
  4. or download this
    q{one="two=xyz" two=abc}
    #      ^embedded keyword pattern
    
    q{one="xyz two=abc three= efg"}
    #          ^missing quotes^
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-25 14:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found