Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: find the starting character position in a line

by linuxer (Curate)
on Apr 16, 2009 at 08:47 UTC ( #757897=note: print w/ replies, xml ) Need Help??


in reply to find the starting character position in a line

$ perl -wle ' $line = " This is a test."; if ( $line =~ m/(\S)/g ) { print pos($line); } ' 4


Comment on Re: find the starting character position in a line
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2015-09-03 02:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred temperature scale is:










    Results (93 votes), past polls