Cold Help System: Programming: ColdC Reference Manual: Functions: String: match_pattern()


LIST match_pattern(STRING string, STRING pattern)

This function matches the wildcard pattern pattern against string. A wildcard pattern is a string with asterixes (`*') signifying wildcards. A regular character matches itself, while a wildcard matches any number of arbitrary characters. The return value of match_pattern() is a list of the substrings of string which matched the wildcards in pattern, or 0 if the match fails. More information on pattern matching can be found in the section Matching Conventions. Examples:

match_pattern("foobar", "*")
=> ["foobar"]
match_pattern("foo quux bar quuux baz", "foo * bar * baz")
=> ["quux", "quuux"]
match_pattern("narf:fnord", "narf:*")
=> ["fnord"]
match_pattern("foo baz", "foo * bar")
=> 0


crypt() | explode() | lowercase() | match_begin() | match_pattern() | match_regexp() | match_template() | pad() | regexp() | strcmp() | strfmt() | strgraft() | strlen() | strsed() | strsub() | substr() | uppercase() | match_crypted() | split() | stridx()


the Cold Dark