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 :
kiytytytyty
and
blob.mkv
command used is :
grep -E ^[a-z]+\.[a-z]{3}$i pow.txt
match returned is:
kiytytytyty
Obviously this wouldn't match with a PCRE regex. Are regexes interpreted differently on mac ? Or is my syntax wrong ?
\.
", you could use "[.]
" to match a period character, and you could use[a-zA-Z]
for the character classes instead of the-i
option togrep
. There's lots of ways to do it!