Perl RegEx in Mac terminal: grep -p "^([^\t]*\t){2}mypattern\t" textfile.txt doesn't work I am a beginner of using programming commands. 

Why {2} is not functional after ([^\t]*\t) in macOS terminal?

Is there any website providing Perl RegEx which works in mac? Thanks!
RegExPlanet offer a Regular Expression Test Page for Perl. This page works with Safari on macOS 10.12.

You may find that grep included with macOS does not include all the functionality you want. If so, try installing grep from Homebrew or MacPorts.