[ create a new paste ] login | about

Link: http://codepad.org/OvfjYi9F    [ raw code | output | fork ]

Perl, pasted on Nov 16:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use strict;

my @str = (
                'S1,F2  title including several white spaces  (abbr) single,Here<->There,reply',
                'S1,F2  title including several white spaces  (abbr) single,Here<->There',
                'S1,F2  title including several white spaces  (abbr) single,Here<->There,[reply]'
          );
foreach(@str) {
        print "Input: $_\n";
        if(/^S(\d),F(\d)\s+(.*?)\((.*?)\)\s+(.*?),(.*?)(?:,(.*))?$/) {                                                                                                                                         
                print "\t$1\n";
                print "\t$2\n";
                print "\t$3\n";
                print "\t$4\n";
                print "\t$5\n";
                print "\t$6\n";
                print "\t$7\n";
        }
}


Output:
Input: S1,F2  title including several white spaces  (abbr) single,Here<->There,reply
	1
	2
	title including several white spaces  
	abbr
	single
	Here<->There
	reply
Input: S1,F2  title including several white spaces  (abbr) single,Here<->There
	1
	2
	title including several white spaces  
	abbr
	single
	Here<->There
	
Input: S1,F2  title including several white spaces  (abbr) single,Here<->There,[reply]
	1
	2
	title including several white spaces  
	abbr
	single
	Here<->There
	[reply]


Create a new paste based on this one


Comments: