my login.txt file contains following entries
abc def
abc 123
def abc
abc de
tha ewe
when i do the positive lookahead using perl, i\'m getting t
grep does not include the newline in the string it checks against the regex, so abc\s
does not match when abc is at the end of the line. chomp in perl or use the -l command line option and you will see similar results.
I'm not sure why you were making other changes between the perl and grep regexes; what was the (?)
supposed to accomplish?