Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] RegEx Help

Expand Messages
  • merlyn@stonehenge.com
    ... Swaroop Dear Member, Swaroop I have a regular expression. How can i find the no.of matchings Swaroop of the regular expression. First, Second
    Message 1 of 2 , Dec 6, 2005
    • 0 Attachment
      >>>>> "Swaroop" == Swaroop Kumar <swaroop_t_mca@...> writes:

      Swaroop> Dear Member,
      Swaroop> I have a regular expression. How can i find the no.of matchings
      Swaroop> of the regular expression. First, Second ...matchings i know as $1,$2...


      my @all_matches = $string =~ /pattern_here/g;

      my $number_of_matches = @all_matches; # array name in scalar context == length

      --
      Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
      <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
      Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
      See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
    Your message has been successfully submitted and would be delivered to recipients shortly.