We always bring snacks on our flights. We have a five-hour flight to MCO on Southwest--and the snacks are heavy on the carbs and preservatives! *LOL*
There is another thread--perhaps on the transportatoin board--mentioning not to bring a container of peanut butter, jelly or cream cheese, but it's fine to make sandwiches containing these ingredients. Anything that is liquid or gelatin (including yogurt, pudding, Jell-o) cannot go through security, although you can purchase those items on the concourse. Medical and some infant items excepted, but must be hand-checked by security separately.
Some flights may be declared peanut-free to a severe allergy of a passenger. That can include peanut butter. So, while you can carry peanut butter sandwiches on board, make alternate plans in case you end up on a peanut-free flight. It isn't announced until you are on board.