libperun

Class std.re.Pattern

Synopsis

public final class Pattern

Represents a compiled regular expression.

Fields

Constructors

public Pattern(String regex);

Construct a pattern.

Methods

public Match match(String str);

Attempt a match at the beginning of the string.

If there is any match at the beginning, including a zero-size match, returns a std.re.Match object; otherwise, returns null.

public Match match(String str,int startPos);

Attempt to match at the specified position.

If there is any match at the indicated position in the string, including a zero-size match, returns a std.re.Match object; otherwise, returns null.

public Match search(String str,int startFrom);

Attempt to find a match in the string.

public Match search(String str);

Attempt to find a match in the string.