Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: Grep Pattern

by rsFalse (Chaplain)
on Dec 15, 2018 at 20:43 UTC ( [id://1227305]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Grep Pattern
in thread Grep Pattern

Here I reset 'pos' when match approaches the end of the pattern, allowing second regex always match:
#!/usr/bin/perl # https://perlmonks.org/?node_id=1227147 use warnings; use strict; my $pattern = 'FTTF'; my @result = grep { $pattern =~ /(?!$)/g; $pattern =~ /./g; $& eq 'T' } 0 .. 12; print "@result\n";

Log In?
Username:
Password:

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

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

    No recent polls found