Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Regex - counting number of '|'

by mickeyn (Priest)
on Mar 18, 2008 at 07:42 UTC ( #674731=note: print w/replies, xml ) Need Help??


in reply to Regex - counting number of '|'

this one works for me:

use strict; my $inp_row = "per|l|mo|nks|ro|ck|s"; print $inp_row =~ tr/\|/\|/, "\n";
HTH,
Mickey

Replies are listed 'Best First'.
Re^2: Regex - counting number of '|'
by ikegami (Pope) on Mar 18, 2008 at 07:54 UTC
    He specifically said he didn't want to hardcode the character, so no good.
      Hi guys!

      Thanks a lot for takin the time out for this...!! I m really grateful...!! I am new to perl and was havin a really tough time with these things... but things are now slowly falling into place....!!

      Again... thanks..!!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://674731]
help
Chatterbox?
[stevieb]: can anyone recommend a good IDE for C programming that has *proper* vim plugin support? I've tried Eclipse, Netbeans etc and just can't get anything to work properly on Linux. I'm open to paying, but not on some monthly/yearly plan (just a one-off cost)
[stevieb]: I'd go with CLion as it's very similar to what I use already (intelliJ for Perl, Pycharm for Python), but it's a recurring fee every year

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2017-01-18 19:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (163 votes). Check out past polls.