Ruby でテキスト ファイルから次のような YAML ヘッダーを削除する方法:
---
date: 2013-02-02 11:22:33
title: "Some Title"
Foo: Bar
...
---
(YAML は 3 つのダッシュ (-) で囲まれています)
私は試した
text.gsub(/---(.*)---/, '') # text is the variable which contains the full text of the file
しかし、うまくいきませんでした。