A "flag" goes at the end of the line and alters the behaviour of the rewrite. The common ones are listed and explained below:

L - Last: when a RewriteRule has been applied and has the L flag, the rewrite engine will stop processing any remaining rules that may follow. See [L] Last Flag for more details on this behaviour.
R - Redirect: a standard RewriteRule is transparent to the user. However you can use the R flag to send back a redirect status code (3xx) and the new location. This will cause the client browser to update the address bar with the destination. This flag takes the status code as a parameter allowing you to send a 301 header if desired. By default, R will send a 302 temporarily moved header, whereas R=301 will send a 301 permanently moved header. To maintain search engine rankings, you will want to use the latter. See moving pages (301).
QSA - Query String Append: on dynamic pages, the query string contains the GET data (i.e. everything after the ?). If you do not include a query string in the destination, the original query string is automatically transferred. If you do specify a query string in the destination, this overwrites the original. If you wish to add to the query string and keep original data intact, you must use the QSA flag.
NC - No case: makes the comparison case insensitive.

regex