Regex functionality on String

This is my partially string

*** HOLE CARDS ***
gogo1978: calls $0.15
istackdoe: checks
*** FLOP *** [5d Qd 2c]
istackdoe: checks
gogo1978: checks
*** TURN *** [5d Qd 2c] [Ah]
istackdoe: checks
gogo1978: checks
*** RIVER *** [5d Qd 2c Ah] [6s]
istackdoe: checks
gogo1978: checks
*** SHOW DOWN ***
istackdoe: shows [9h 2h] (a pair of Deuces)
gogo1978: mucks hand

I need output

*** HOLE CARDS ***
Call gogo1978, $0.15
Check istackdoe:
*** FLOP *** [5d Qd 2c]
Check istackdoe:
Check gogo1978:
*** TURN *** [5d Qd 2c] [Ah]
Check istackdoe:
Check gogo1978:
*** RIVER *** [5d Qd 2c Ah] [6s]
Check istackdoe:
Check gogo1978:
*** SHOW DOWN ***
Show istackdoe: [9h 2h] (a pair of Deuces)
gogo1978: mucks hand

There is possibility that istackdoe and gogo1978 not be fixed everytime
means it will be different name in another string

Thanks…

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs