Package net.sf.saxon.regex.charclass
Class Categories
- java.lang.Object
-
- net.sf.saxon.regex.charclass.Categories
-
public class Categories extends java.lang.Object
Singleton class holding data for Regular expression character categories.The data is read from an XML file derived from the Unicode database (In Saxon 9.6, this is based on Unicode 6.2.0). Since Saxon 9.4, we no longer make use of Java's support for character categories since there are too many differences from Unicode.
Some commonly used categories are hard-coded and made available as static constants.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Categories.Category
A Category is a CharacterClass represented in a regular expression as \p{Xx}.
-
Field Summary
Fields Modifier and Type Field Description static PredicateCharacterClass
ESCAPE_c
static CharacterClass
ESCAPE_C
static Categories.Category
ESCAPE_d
static CharacterClass
ESCAPE_D
static PredicateCharacterClass
ESCAPE_i
static CharacterClass
ESCAPE_I
static CharacterClass
ESCAPE_s
static CharacterClass
ESCAPE_S
static PredicateCharacterClass
ESCAPE_w
static CharacterClass
ESCAPE_W
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Categories.Category
getCategory(java.lang.String cat)
Get a predicate to test characters for membership of one of the Unicode character categories
-
-
-
Field Detail
-
ESCAPE_s
public static final CharacterClass ESCAPE_s
-
ESCAPE_S
public static final CharacterClass ESCAPE_S
-
ESCAPE_i
public static final PredicateCharacterClass ESCAPE_i
-
ESCAPE_I
public static final CharacterClass ESCAPE_I
-
ESCAPE_c
public static final PredicateCharacterClass ESCAPE_c
-
ESCAPE_C
public static final CharacterClass ESCAPE_C
-
ESCAPE_d
public static final Categories.Category ESCAPE_d
-
ESCAPE_D
public static final CharacterClass ESCAPE_D
-
ESCAPE_w
public static final PredicateCharacterClass ESCAPE_w
-
ESCAPE_W
public static final CharacterClass ESCAPE_W
-
-
Method Detail
-
getCategory
public static Categories.Category getCategory(java.lang.String cat)
Get a predicate to test characters for membership of one of the Unicode character categories- Parameters:
cat
- a one-character or two-character category name, for example L or Lu- Returns:
- a predicate that tests whether a given character belongs to the category
-
-