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

Re: Please correct me in the above regular expression

by hippo (Bishop)
on Mar 20, 2021 at 22:28 UTC ( [id://11130016]=note: print w/replies, xml ) Need Help??


in reply to Please correct me in the above regular expression

See How to ask better questions using Test::More and sample data

use strict; use warnings; use Test::More tests => 1; my $in = "int abc;\n.abc(abc)"; my $want = ['abc', '.abc', '(abc']; my @have = $in =~ /([\.(]?abc)/g; is_deeply \@have, $want;

🦛

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-24 15:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found