Posted by Peter Stidsen on 10/08/41 11:30
Hi,
I need to get some info from a string, and I was told to Google for regex.
Honestly I still don't have a clue about what to do.
$string = "(;GM[1]FF[4]CA[UTF-8]AP[CGoban:2]ST[2]
RU[Japanese]SZ[19]KM[0.50]TM[600]OT[25/240 Canadian]
PW[winifred]PB[artipode]WR[8k]BR[9k]DT[2004-03-05]PC[The Kiseido Go Server
(KGS) at http://kgs.kiseido.com/]RE[W+115.50] (...)"
From this I need to find a way to:
$pw = "winifred"
$pb = "artipode"
$wr = "8k"
$br = "9k"
$dt = "2004-03-05"
$re = "W+115.50"
$pc = "The Kiseido Go Server (KGS) at http://kgs.kiseido.com/"
It's the value that is important, not the stringname. I just need to know
what comes from where.
Any help or points in the right dirrection is much appreciated.
Thanks in advance
Peter
Navigation:
[Reply to this message]
|