Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Pattern finding and printing with regex

by jeffa (Bishop)
on Oct 21, 2015 at 18:28 UTC ( #1145574=note: print w/replies, xml ) Need Help??


in reply to Pattern finding and printing with regex

It helps us more if you provide the data too, but as it stands you should only need to add

$line =~ s/^$pattern//;
before you print the matched line.




jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re^2: Pattern finding and printing with regex
by kernelpanic@thedisco (Initiate) on Oct 21, 2015 at 18:38 UTC
    Thanks! That did it.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2018-11-15 14:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My code is most likely broken because:
















    Results (186 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!