does grep regex work differently on mac?
Sebastian Wright
Just trying to figure out basic use of regexes with grep (or egrep) in mac terminal (BSD grep - 2.5.1-FreeBSD).
File to examine (pow.txt) contains the lines :
kiytytytytyand
blob.mkvcommand used is :
grep -E ^[a-z]+\.[a-z]{3}$i pow.txtmatch returned is:
kiytytytytyObviously this wouldn't match with a PCRE regex. Are regexes interpreted differently on mac ? Or is my syntax wrong ?
81 Answer
If you're trying to match blob.mkv, try:
grep -Ei '^[a-z]+\.[a-z]{3}$' pow.txt 2