Alex & Sebastian,
Thanks for taking the time to reply. The string.gsub(/start.*end/m,
'some_value') did indeed help, but I am afraid my problem is a bit more
complicated.
I am basically trying to cleanup a long xml file. A typical part of the
string looks like this:
<div class="field field-type-text field-field-audience">
<h3 class="field-label">audience</h3>
<div class="field-items">
<div class="field-item">Public</div>
</div>
</div>
<div class="field field-type-text field-field-creator">
<h3 class="field-label">creator</h3>
<div class="field-items">
<div class="field-item">Tom Jones</div>
</div>
</div>
I am trying to format it like this:
<audience>Public</audience>
<creator>Tom Jones</creator>
So the problem is that the values in the xml change throughout the
string, so I cannot do a pattern match for them directly. Any ideas
would be hugely appreciated!
Jan
--
Posted via http://www.ruby-forum.com/.