Grep has no flag -P


#1

The Suggested solution goes like
grep -P ‘^(\d{3}-|(\d{3}) )\d{3}-\d{4}$’ input

but doing man grep on my Mac terminal, produces no flag -P. Please resolve this dilemma. Also, the same statement gives error for a ‘P’ flag [Obviously]


#2


#3

Kindly tell me the platform that gives you this output on ‘man grep’.


#4

I am using MacOS. -P flag is present in this.


#5

:joy: How is that even possible? Same machines, same command different outputs. I guess nothing more can be done here then.