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

Replies are listed 'Best First'.
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!