org.jext.search
Class RESearchMatcher

java.lang.Object
  extended byorg.jext.search.RESearchMatcher
All Implemented Interfaces:
SearchMatcher

public class RESearchMatcher
extends java.lang.Object
implements SearchMatcher

A regular expression string matcher.

Version:
$Id: RESearchMatcher.java,v 1.2 2001/08/29 20:29:42 gfx Exp $
Author:
Slava Pestov

Field Summary
static gnu.regexp.RESyntax RE_SYNTAX_JEXT
          Perl5 syntax with character classes enabled.
 
Constructor Summary
RESearchMatcher(java.lang.String search, java.lang.String replace, boolean ignoreCase, boolean script, java.lang.String pythonScript)
          Creates a new regular expression string matcher.
 
Method Summary
 int[] nextMatch(javax.swing.text.Segment text)
          Returns the offset of the first match of the specified text within this matcher.
 java.lang.String substitute(java.lang.String text)
          Returns the specified text, with any substitution specified within this matcher performed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RE_SYNTAX_JEXT

public static final gnu.regexp.RESyntax RE_SYNTAX_JEXT
Perl5 syntax with character classes enabled.

Since:
jEdit 3.0pre5
Constructor Detail

RESearchMatcher

public RESearchMatcher(java.lang.String search,
                       java.lang.String replace,
                       boolean ignoreCase,
                       boolean script,
                       java.lang.String pythonScript)
                throws java.lang.Exception
Creates a new regular expression string matcher.

Method Detail

nextMatch

public int[] nextMatch(javax.swing.text.Segment text)
Returns the offset of the first match of the specified text within this matcher.

Specified by:
nextMatch in interface SearchMatcher
Parameters:
text - The text to search in
Returns:
an array where the first element is the start offset of the match, and the second element is the end offset of the match

substitute

public java.lang.String substitute(java.lang.String text)
                            throws java.lang.Exception
Returns the specified text, with any substitution specified within this matcher performed.

Specified by:
substitute in interface SearchMatcher
Parameters:
text - The text
Returns:
The changed string
Throws:
java.lang.Exception


Copyright ? 2002 Romain Guy.