org.basex.query.regex
Class Escape

java.lang.Object
  extended by org.basex.query.regex.RegExp
      extended by org.basex.query.regex.Escape

public final class Escape
extends RegExp

Escape sequence.

Author:
BaseX Team 2005-12, BSD License, Leo Woerteler

Method Summary
static char[] escape(int cp)
          Escapes code points for use in character ranges.
static RegExp get(java.lang.String esc)
          Creates a regular expression from the given escape sequence.
static char getCp(java.lang.String single)
          Gets the character escaped by the given single escape.
static RegExp[] inGroup(java.lang.String esc)
          Translates the given escape into character ranges if possible.
 
Methods inherited from class org.basex.query.regex.RegExp
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

get

public static RegExp get(java.lang.String esc)
Creates a regular expression from the given escape sequence.

Parameters:
esc - escape sequence
Returns:
regular expression

getCp

public static char getCp(java.lang.String single)
Gets the character escaped by the given single escape.

Parameters:
single - single-char escape sequence
Returns:
the escaped char

inGroup

public static RegExp[] inGroup(java.lang.String esc)
Translates the given escape into character ranges if possible.

Parameters:
esc - escape sequence
Returns:
array of regular expressions suitable for char groups

escape

public static char[] escape(int cp)
Escapes code points for use in character ranges.

Parameters:
cp - code point
Returns:
char representation