The default implementation of the system regular expression library.
More...
|
bool | RegexMatch (string regularExpression, string expressionOps, string value) |
| Matches a regular expression against a string value. More...
|
|
IList< int > | RegexSearch (Table table, int column, string regularExpression, string expressionOps) |
| Performs a regular expression search on the given column of the table. More...
|
|
The default implementation of the system regular expression library.
Definition at line 26 of file SystemRegexLibrary.cs.
bool Deveel.Data.Text.SystemRegexLibrary.RegexMatch |
( |
string |
regularExpression, |
|
|
string |
expressionOps, |
|
|
string |
value |
|
) |
| |
|
inline |
Matches a regular expression against a string value.
- Parameters
-
regularExpression | The regular expression to match. |
expressionOps | The expression options string that specifies various flags. |
value | The string to test. |
- Returns
- If the value is a match against the expression then it returns true, otherwise it returns false.
Implements Deveel.Data.Text.IRegexLibrary.
Definition at line 28 of file SystemRegexLibrary.cs.
29 RegexOptions options = RegexOptions.None;
31 if (expressionOps != null) {
32 if (expressionOps.IndexOf(
'i') != -1) {
33 options |= RegexOptions.IgnoreCase;
35 if (expressionOps.IndexOf(
's') != -1) {
36 options |= RegexOptions.Singleline;
38 if (expressionOps.IndexOf(
'm') != -1) {
39 options |= RegexOptions.Multiline;
43 Regex regex =
new Regex(regularExpression, options);
44 return regex.IsMatch(value);
IList<int> Deveel.Data.Text.SystemRegexLibrary.RegexSearch |
( |
Table |
table, |
|
|
int |
column, |
|
|
string |
regularExpression, |
|
|
string |
expressionOps |
|
) |
| |
|
inline |
Performs a regular expression search on the given column of the table.
- Parameters
-
table | The table to search for matching values. |
column | The column of the table to search for matching values. |
regularExpression | The expression to match (eg. "[0-9]+"). |
expressionOps | Expression operator string that specifies various flags. |
- Returns
- Returns an IntegerVector that contains the list of rows in the table that matched the expression, or an empty list if the expression matched no rows in the column.
Implements Deveel.Data.Text.IRegexLibrary.
Definition at line 47 of file SystemRegexLibrary.cs.
49 IList<int> row_list = table.SelectAll(column);
51 List<int> result_list =
new List<int>();
57 RegexOptions options = RegexOptions.None;
58 if (expressionOps != null) {
59 if (expressionOps.IndexOf(
'i') != -1) {
60 options |= RegexOptions.IgnoreCase;
62 if (expressionOps.IndexOf(
's') != -1) {
63 options |= RegexOptions.Singleline;
65 if (expressionOps.IndexOf(
'm') != -1) {
66 options |= RegexOptions.Multiline;
70 regex =
new Regex(regularExpression, options);
77 int size = row_list.Count;
78 for (
int i = 0; i < size; ++i) {
79 int row_index = row_list[i];
80 TObject cell = table.GetCell(column, row_index);
84 String str = ob.ToString();
86 if (regex.IsMatch(str)) {
87 result_list.Add(row_index);
A long string in the system.
The documentation for this class was generated from the following file:
- /var/calculate/remote/distfiles/egit-src/deveeldb.git/src/deveeldb/Deveel.Data.Text/SystemRegexLibrary.cs