[ library(regex) | The ECLiPSe Libraries | Reference Manual | Alphabetic Index ]

# match(+Pattern, +String)

A substring of String matches the regular expression Pattern

Pattern
  A string (or a compiled pattern handle)
String
  A string

## Description

Succeeds if all or a substring of String matches the regular expression Pattern. For the description of regular expressions see the library(regex) page.

Equivalent to match(Pattern, String, []).

### Modes and Determinism

- match(+, +) is semidet

### Fail Conditions

String does not match Pattern

## Examples

        ?- match("aca", "abracadabra").
        Yes

        ?- match("^a[cd]a$", "abracadabra").
        No

        ?- match("^a[cd]a$", "ada").
        Yes

## See Also

library(regex), match / 3, match / 4, matchsub / 4, matchall / 4, split / 4, compile_pattern / 3