Grep has no flag -P


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]



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


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


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