<p>I'm developing a poker game in C#. At the moment I'm trying to get the players hand score using <code>RegEx</code>. I search the string (composed of the cards suit and number) and look for suits or numbers to match the <code>RegEx</code>. If i get 2 matches then the player has a pair, 3 matches he has 3 of a kind. </p>

<p>I have 3 classes at the moment, a Card class (with number and suit), a Deck class (that contains 52 Cards) and a Hand class that gets five cards from the shuffled deck.</p>

<p>Deck class has a <code>shuffleDeck()</code>;
Hand class has the functions to calculate the score (is in these functions that I am using RegEx).</p>

<p>I generate the string on which I use <code>RegEx</code> by adding the 5 suits and numbers that the hand has.</p>

<p>Is this a good idea or should I do it another way, if so, how?</p>

<p>Thank you for your help</p>

<p>PS. I am one of the unexperienced programmers that want to use a newly learned tool for everything</p>

You have not provided much detail, but what from what I have read, I assume you're not pushing the OOP very far...
I would have a Card class that has a Rank and Suit class instances. I would then have a deck class that handles shuffling / dealing...
I would then have a Hand class that would contain your poker hand of n Card objects...
In this way you can build up rules to evaluate each hand object, thus being more flexible and more extensible in the future...say if you want to make another card game / add support for another variant of poker...
Using Regular expressions to do all of this seems to be a pretty poor choice.