我想分析該行,這一點,問題文本分析在Perl
S1,F2 title including several white spaces (abbr) single,Here<->There,reply
而且我想爲下面的輸出,
1
2
title including several white spaces
abbr
single
Here22There # identify <-> and translate it to 22;
reply
我想知道如何解析上面的線?
方法1. 我打算整行被劃分到四個段然後解析各個子段。
segment1。 S1,F2
分段2。 title including several white spaces
segment3。 abbr
segment4。 single,Here<->There,reply
方法2 我只寫一個複雜的正則表達式語句解析它。
哪種方法更適合我的實踐?
讚賞任何意見或建議。
的可能重複[需要幫助Perl reg ex? ](http://stackoverflow.com/questions/4192213/need-help-with-perl-reg-ex)那是一個在這之後,但是有一個更好的答案是一個更好的問題 - 這是一個確切的基本問題。 – Axeman 2010-11-16 15:09:29