Regex.count.3kaya

Langue: en

Version: March 2009 (fedora - 06/07/09)

Section: 3 (Bibliothèques de fonctions)

NAME

Regex::count - Count occurrences of a regular expression in a string.

SYNOPSIS

Int count( Regex patt, String str )

ARGUMENTS

patt A compiled regular expression

str The String to count in

DESCRIPTION

Count the number of (non-overlapping) matches for patt in str
 Note that this function will not give meaningful results for patterns containing ^ or $


 count(compile("abc"),"abcdefgh"); // 1
 count(compile("a"),"abcdefebcda"); // 2
 count(compile("a.[^a]"),"aabbccaabbccaa"); // 2

AUTHORS

Kaya standard library by Edwin Brady, Chris Morris and others (kaya@kayalang.org). For further information see http://kayalang.org/

LICENSE

The Kaya standard library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (version 2.1 or any later version) as published by the Free Software Foundation.

Regex.compile(3kaya)

Regex.split(3kaya)