On 12/18/07, scooter <[EMAIL PROTECTED]> wrote:

> Can someone help me with the regexp that will match exactly two
> quotes(') or no quotes in the string.
> If a single quote exists, then will break out.

You are saying what you want for the cases of zero, one, or two single
quote marks in the string. What would you like to cause to happen in
other cases?

If you're interested in counting the number of times that a particular
character occurs in a string, the tr/// operator is probably what you
want.

  my $some_string = q{This isn't a 'test'.};
  my $count = ($some_string =~ tr/'/'/);

Hope this helps!

--Tom Phoenix
Stonehenge Perl Training

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to