Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Problem with input strings that have "[]" brackets

by afoken (Chancellor)
on May 09, 2015 at 06:19 UTC ( [id://1126172]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use 5.018;
    
    my $line = '        [Category("notestrecord")]';
    my $pattern = qr/[Category("notestrecord")]/;
     
    if($line =~ /\s*$pattern/)
    
  2. or download this
    >perl -e 'use 5.018; my $x=qr/a[bc]d/; say("|$_| matches |$x|: ",$_=~/
    +$x/ ? "yes" : "no") for ( "abd","acd","abcd","a[bc]d" )'
    |abd| matches |(?^u:a[bc]d)|: yes
    ...
    |abcd| matches |(?^u:a[bc]d)|: no
    |a[bc]d| matches |(?^u:a[bc]d)|: no
    >
    
  3. or download this
    #!/usr/bin/perl -w
    use 5.018;
    
    ...
    
    =cut
    
  4. or download this
    >perl 1126159-modified.pl
    Matched |(?^u:["()Cacdegnorsty])| in |        [Category("notestrecord"
    +)]|
    >
    

Log In?
Username:
Password:

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

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

    No recent polls found