Can you tell me when and why I should use commas before and after such as?
Our research shows that you should never follow such as by a comma, as this handy phrase introduces one or more examples.
Using a comma before such as may be required by the sentence or it may be optional. When such as introduces a modifier that is not essential to the meaning of the sentence (i.e. a non-restrictive modifier), commas are required. For example:
The modifier such as rubies is not essential; it simply adds details and therefore calls for commas.
Conversely, modifiers or word strings that are essential to the meaning of the sentence (i.e. restrictive modifiers) are not separated by commas. For example:
The word string street, avenue, and road is essential to the meaning and so should not be separated by commas.