Eric's solution is better for large files because it requires reading
the file line by line only. Note that it uses a special feature of
"if" when using a range with boolean expressions: in that case
matching state is stored and the complete expression is true when the
first matches, stays true and only switches back to false if the
second matches:
Am Freitag, 18. Dez 2009, 23:39:40 +0900 schrieb Robert Klemme:
2009/12/18 beny 18241 <beny18241@gmail.com>:
> ok closed Ifigue it out
>
> puts ARGF.read.scan(/<mms:MmsCcppAccept>.*?<\/mms:MmsCcppAccept>/m)
Eric's solution is better for large files because it requires reading
the file line by line only. Note that it uses a special feature of
"if" when using a range with boolean expressions: in that case
matching state is stored and the complete expression is true when the
first matches, stays true and only switches back to false if the
second matches: