Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Regex - remove characters (pattern not terminated) perl6

by eric256 (Parson)
on Jun 30, 2010 at 13:56 UTC ( #847340=note: print w/ replies, xml ) Need Help??


in reply to Regex - remove characters (pattern not terminated)

Just playing around with Perl6 some

#!/home/ejh/rakudo/perl6 my @temp = ("1234567", "7654321"); my $pat = "123"; my $rpat = "321"; for @temp -> $test { print "Testing '$test' - "; my $t = $test; if $t ~~ s/$pat// or $t ~~ /$rpat/ { say "($t) matched"; } }

___________
Eric Hodges


Comment on Re: Regex - remove characters (pattern not terminated) perl6
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2015-07-03 16:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (54 votes), past polls