blob: 64ccc3793171876f7e24b12bca62eb5c2d65515f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
using System.Text.RegularExpressions;
namespace Mammoth.Couscous.java.util.regex {
internal class Pattern {
internal static Pattern compile(string pattern) {
return new Pattern(pattern, new Regex(pattern));
}
internal static bool matches(string regex, string input) {
return Regex.IsMatch(input, regex);
}
private readonly string _pattern;
private readonly Regex _regex;
internal Pattern(string pattern, Regex regex) {
_pattern = pattern;
_regex = regex;
}
internal string pattern() {
return _pattern;
}
internal Matcher matcher(string value) {
return new Matcher(_regex, value);
}
}
}
|