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

Re^3: grep function does not recognize string

by choroba (Abbot)
on May 07, 2012 at 12:41 UTC ( #969253=note: print w/ replies, xml ) Need Help??


in reply to Re^2: grep function does not recognize string
in thread grep function does not recognize string

Use <readmore> tags for long portions of code or data.

The reason is that you do not anchor your regex with ^, but you test the result of grep to be == 1. But for 4285, the result is == 2, because 4285 is contained in both 4285 and 24285.


Comment on Re^3: grep function does not recognize string
Re^4: grep function does not recognize string
by korak (Initiate) on May 08, 2012 at 07:09 UTC

    Yes!!! Of course....
    Thanks a lot, I did not think of that! Now it works perfect!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2014-08-22 00:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (144 votes), past polls