net.sf.saxon.regex

## Class RECompiler

- java.lang.Object
- - net.sf.saxon.regex.RECompiler

-     public class RECompiler
      extends Object

  A regular expression compiler class. This class compiles a pattern string into a regular expression program interpretable by the RE evaluator class. The 'recompile' command line tool uses this compiler to pre-compile regular expressions for use with RE. For a description of the syntax accepted by RECompiler and what you can do with regular expressions, see the documentation for the RE matcher class.
  Version:
    $Id: RECompiler.java 518156 2007-03-14 14:31:26Z vgritsenko $
  Author:
    Jonathan Locke, Michael McCallum
  See Also:
    `REMatcher`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RECompiler()` Constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `REProgram` | `compile(UnicodeString pattern)` Compiles a regular expression pattern into a program runnable by the pattern matcher class 'RE'.
    `List<String>` | `getWarnings()` On completion of compilation, get any warnings that were generated
    `void` | `setFlags(REFlags flags)` Set the regular expression flags to be used

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RECompiler

          public RECompiler()

      Constructor. Creates (initially empty) storage for a regular expression program.

  - ### Method Detail

    - #### setFlags

          public void setFlags(REFlags flags)

      Set the regular expression flags to be used
      Parameters:
        `flags` - the regular expression flags

    - #### getWarnings

          public List<String> getWarnings()

      On completion of compilation, get any warnings that were generated
      Returns:
        the list of warning messages

    - #### compile

          public REProgram compile(UnicodeString pattern)
                            throws RESyntaxException

      Compiles a regular expression pattern into a program runnable by the pattern matcher class 'RE'.
      Parameters:
        `pattern` - Regular expression pattern to compile (see RECompiler class for details).
      Returns:
        A compiled regular expression program.
      Throws:
        `RESyntaxException` - Thrown if the regular expression has invalid syntax.
      See Also:
        `RECompiler`, `REMatcher`

Copyright (c) 2004-2013 Saxonica Limited. All rights reserved.