All regulations, ordinances, and laws of the City and County of San Francisco are contained in the municipal codes, your primary source for local legal information. San Francisco has 14 different codes covering the full range of municipal law, from the Business and Tax Regulation Code to the Traffic Code.
You'll find links to full-text versions of all of these documents on the City government's Web site at SFGov.org, as well as links to local zoning maps and the San Francisco Charter. The San Francisco Main Library also holds hard copies of the documents. Resources are easily accessible but if you're undertaking your own research, be sure to also verify your conclusions with the appropriate city agency.
See About.com's article, Code Check, for help with building codes and commonly cited code violations encountered by building inspectors with construction projects.