Valadoc | Vala | Tutorial | API-References | Markup

match_all


Description:

public bool match_all (string str, RegexMatchFlags match_options = 0, out MatchInfo match_info = null)

Using the standard algorithm for regular expression matching only the longest match in the string is retrieved. This function uses a different algorithm so it can retrieve all the possible matches. For more documentation see g_regex_match_all_full().

A GMatchInfo structure, used to get information on the match, is stored in match_info if not NULL. Note that if match_info is not NULL then it is created even if the function returns FALSE, i.e. you must free it regardless if regular expression actually matched.

string is not copied and is used in GMatchInfo internally. If you use any GMatchInfo method (except g_match_info_free()) after freeing or modifying string then the behaviour is undefined.

Parameters:

regex a GRegex structure from g_regex_new()
string the string to scan for matches
match_options match options
match_info pointer to location where to store the GMatchInfo, or NULL if you do not need it. [out][allow-none]

Returns:

TRUE is the string matched, FALSE otherwise