# Regex functionality on String

**URL:** <https://www.ruby-forum.com/t/regex-functionality-on-string/137005>\
**Category:** Rails\
**Created:** [May 8, 2008, 7:05am UTC](https://www.ruby-forum.com/t/regex-functionality-on-string/137005 "2008-05-08T07:05:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![brijesh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f475e1/32.png) [@brijesh](https://www.ruby-forum.com/u/brijesh)\
**Post date:** [May 8, 2008, 7:05am UTC](https://www.ruby-forum.com/t/regex-functionality-on-string/137005/1 "2008-05-08T07:05:19Z")

</div>

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…
