Google this..See the big tile; that is where the exceptions are...Lol...Lol...
Gil....
BUSINESS AND PROFESSIONS CODE
SECTION 16600-16607
16600. Except as provided in this chapter, every contract by which
anyone is restrained from engaging in a lawful profession, trade, or
business of any kind is to that extent VOID.