Does not the m// when used like:

count = m/<strVar>/ig;

?
TW



On Fri, 19 Jan 2001, Cornish, Merrill wrote:

> s/// will return the number of replacements it makes.  If you replace the
> substring with itself, then you will get the count without _appearing_ to
> make any replacements.
>
> Merrill
>
> > -----Original Message-----
> > From:       Roman Melihhov [SMTP:[EMAIL PROTECTED]]
> > Sent:       Friday, January 19, 2001 2:22 PM
> > To: '[EMAIL PROTECTED]'
> > Subject:    Regexp?
> > Importance: High
> >
> > Hi,
> > Is there an elegant way to determine number of times substring is repeated
> >
> > within a string except a loop with incrementing counter. Regexp perhaps?
> > Ideas appreciated.
> >
> > Roman.
> >
> >
> _______________________________________________
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
>

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to