com.mckoi.database.regexbridge
Class GNURegex

java.lang.Object
  extended by com.mckoi.database.regexbridge.GNURegex
All Implemented Interfaces:
RegexLibrary

public class GNURegex
extends java.lang.Object
implements RegexLibrary

A bridge to the GNU Java regular expression library. This library is released under the LGPL license which is fully compatible with the GPL license but may be incompatible with other licenses.

Author:
Tobias Downer

Constructor Summary
GNURegex()
           
 
Method Summary
 boolean regexMatch(java.lang.String regular_expression, java.lang.String expression_ops, java.lang.String value)
          Matches a regular expression against a string value.
 IntegerVector regexSearch(Table table, int column, java.lang.String regular_expression, java.lang.String expression_ops)
          Performs a regular expression search on the given column of the table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GNURegex

public GNURegex()
Method Detail

regexMatch

public boolean regexMatch(java.lang.String regular_expression,
                          java.lang.String expression_ops,
                          java.lang.String value)
Description copied from interface: RegexLibrary
Matches a regular expression against a string value. If the value is a match against the expression then it returns true.

Specified by:
regexMatch in interface RegexLibrary
Parameters:
regular_expression - the expression to match (eg. "[0-9]+").
expression_ops - expression operator string that specifies various flags. For example, "im" is like '/[expression]/im' in Perl.
value - the string to test.

regexSearch

public IntegerVector regexSearch(Table table,
                                 int column,
                                 java.lang.String regular_expression,
                                 java.lang.String expression_ops)
Description copied from interface: RegexLibrary
Performs a regular expression search on the given column of the table. Returns an IntegerVector that contains the list of rows in the table that matched the expression. Returns an empty list if the expression matched no rows in the column.

Specified by:
regexSearch in interface RegexLibrary
Parameters:
table - the table to search for matching values.
column - the column of the table to search for matching values.
regular_expression - the expression to match (eg. "[0-9]+").
expression_ops - expression operator string that specifies various flags. For example, "im" is like '/[expression]/im' in Perl.