Question : Complex string parsing

Hello Experts,

In my application I have a richedit control that contains some text like in the code example below and basically all I want to do is to parse out the following lines from the original text.

3 52 "xxxxxxxxx"  
4 82 "xxxxxxxxxxxxxxx"
2 86 "xxxxx"
3 48 "xxxxxxxx"
28 53 "xxxxxxxxxxxxx"
18 31 "xxxxx"
15 66 "xxxxxxxxxxxx"
4 56 "xxxxxxxxxx"
7 219 "xxxx"
11 84 "xxxxxxx"
0 999 "xxxxxxxxxx"
7 95 "xxxxxxxxx"
12 215 "xxxxxxxxx"

but the problem is these lines can start anywhere within the string for instance they can start at the very top of the string or in the middle or at the bottom like in the example below and the number of lines can also vary as well and the only constant is that all the lines are grouped together like in the example but I am not sure how helpful that might be and I am really stuck here so if anyone knows how I can get this information out of the original string I would be most grateful and I thank you in advance for any and all replies. Finally I just wanted to say the x's are actually usernames and not just a bunch of x's but I used x's to protect the privacy of the users just incase you might be wondering what the x's were about.

Pete
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
sv_maxclients
32
sv_allowdownload
0
g_matchmode
0
g_gametype
3
sv_floodprotect
1
g_warmup
15
capturelimit
0
sv_hostname
**1up Fun Server TDM**
g_followstrict
1
fraglimit
150
timelimit
20
g_cahtime
60
g_swaproles
0
g_roundtime
3
g_bombexplodetime
40
g_bombdefusetime
10
g_hotpotato
2
g_waverespawns
0
g_redwave
15
g_bluewave
15
g_respawndelay
1
g_suddendeath
1
g_maxrounds
0
g_friendlyfire
0
g_allowvote
0
g_armbands
0
dmflags
0
sv_minRate
0
sv_maxRate
0
sv_minPing
0
sv_maxPing
350
sv_dlURL
http://www.1upclan.info/public/upload/maps
g_maxGameClients
32
g_deadchat
1
g_gear
0
g_teamnamered
Red
g_teamnameblue
Blue
g_survivorrule
0
version
ioq3 1.35urt linux-i386 Jul 14 2010
protocol
68
mapname
ut4_casa
sv_privateClients
4
bot_minplayers
0
gamestartup
07-25-2010 04:18:06
Admin
xxxxxxxxxx
Email
xxxxxxxxxx
gamename
q3ut4
g_needpass
0
g_enableDust
0
g_enableBreath
0
g_antilagvis
0
g_survivor
0
g_enablePrecip
0
g_modversion
4.1
3 52 "xxxxxxxxx"  <---- I want to start parsing from here 
4 82 "xxxxxxxxxxxxxxx"
2 86 "xxxxx"
3 48 "xxxxxxxx"
28 53 "xxxxxxxxxxxxx"
18 31 "xxxxx"
15 66 "xxxxxxxxxxxx"
4 56 "xxxxxxxxxx"
7 219 "xxxx"
11 84 "xxxxxxx"
0 999 "xxxxxxxxxx"
7 95 "xxxxxxxxx"
12 215 "xxxxxxxxx" <---- and end parsing here

Answer : Complex string parsing


read this one:http://www.regular-expressions.info/characters.html#qe

"Escaping a single metacharacter with a backslash works in all regular expression flavors. Many flavors also support the \Q...\E escape sequence. All the characters between the \Q and the \E are interpreted as literal characters. E.g. \Q*\d+*\E matches the literal text *\d+*. The \E may be omitted at the end of the regex, so \Q*\d+* is the same as \Q*\d+*\E. "


regards.
Random Solutions  
 
programming4us programming4us