If a new building department regulation goes into effect subsequent to the signing of a lease, either the tenant or the landlord has to comply with that regulation. In most cases, the landlord stipulates that the tenant is fully responsible for complying with all laws and regulations. However, it is usually possible to prevent the tenant from being fully responsible for capital improvements. An excellent example of this is retrofitting a space for a sprinkler-based fire prevention system.
The best time to leave a property is upon expiration of the lease term, but there is always room for negotiation.
Several months ago, a client (the tenant) had a lease that was close to expiration. The tenant was about to sign a lease for a different space, but something happened: Another property came on the market, they looked at it and decided it was much better suited for their business. However, starting all over in the negotiation process would have put the tenant over their current lease expiration date. In order to acquire the new space, the tenant would have to extend their current lease, or pay a penalty.