|
|
1.1 root 1: .TH REGEX 3 deprecated
2: .SH NAME
3: re_comp, re_exec \(mi regular expression handler
4: .SH SYNOPSIS
5: .nf
6: .B char *re_comp(s)
7: .B char *s;
8: .PP
9: .B re_exec(s)
10: .B char *s;
11: .fi
12: .SH DESCRIPTION
13: .I Re_comp
14: compiles a regular expression into an internal form suitable for
15: pattern matching.
16: .I Re_exec
17: checks the argument string against the last string passed to
18: .I re_comp.
19: .PP
20: .I Re_comp
21: returns
22: .L 0
23: if the string
24: .I s
25: was compiled successfully; otherwise a string containing an
26: error message is returned. If
27: .I re_comp
28: is passed
29: .L 0
30: or a null string, it returns without changing the currently
31: compiled regular expression.
32: .PP
33: .I Re_exec
34: returns 1 if the string
35: .I s
36: matches the last compiled regular expression,
37: .L 0
38: if the string
39: .I s
40: failed to match the last compiled regular expression, and
41: .L -1
42: if the compiled regular expression was invalid (indicating an
43: internal error).
44: .PP
45: The strings passed to both
46: .I re_comp
47: and
48: .I re_exec
49: may have trailing or embedded newline characters;
50: they are terminated by nulls.
51: The regular expressions are otherwise as described for
52: .IR ed (1).
53: .SH "SEE ALSO"
54: .IR ed (1),
55: .IR expr (1),
56: .IR regexp (3)
57: .SH DIAGNOSTICS
58: .I Re_exec
59: returns
60: .L -1
61: for an internal error.
62: .SH BUGS
63: These routines have been superseded by
64: the more general routines of
65: .IR regexp (3).
66: They have been retained only for compatibility.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.