Function

GLib-2.0GLibregex_match_simpleSince 2.14

  • Scans for a match in string for pattern.

    This function is equivalent to g_regex_match() but it does not require to compile the pattern with g_regex_new(), avoiding some lines of code when you need just to do a match without extracting substrings, capture counts, and so on.

    If this function is to be called on the same pattern more than once, it's more efficient to compile the pattern once with g_regex_new() and then use g_regex_match().

    Parameters

    • pattern: string

      the regular expression

    • string: string

      the string to scan for matches

    • compile_options: RegexCompileFlags

      compile options for the regular expression, or 0

    • match_options: RegexMatchFlags

      match options, or 0

    Returns boolean

    true if the string matched, false otherwise

    2.14