Interface RE.C

All Superinterfaces:
RE
Enclosing interface:
RE

public static interface RE.C extends RE
Represents a Character Class in a regular expression. This is an additional type since character classes have some special rules.
  • Method Details

    • and

      RE.C and(RE.C and)
      Intersect two character classes. This uses the `invalid input: '&'invalid input: '&'` operator. I.e. `[%abc@]` and `\p{Alnum}` will intersect to only `abc` and will be represented as `[abcinvalid input: '&'invalid input: '&'\p{Alnum}`.
      Parameters:
      and - the second character class
      Returns:
      a new character class
    • or

      RE.C or(RE.C or)
      Make the union of two character classes. This concatenates the set if possible. I.e. `[%abc@]` and `\p{Alnum}` will union to `[%abc@\p{Alnum}]`.
      Parameters:
      or - the second character class
      Returns:
      a new character class
    • or

      default RE.C or(String or)
      Make the union of two character classes. This concatenates the set if possible. I.e. `[%abc@]` and `\p{Alnum}` will union to `[%abc@\p{Alnum}]`.
      Parameters:
      or - the second character class
      Returns:
      a new character class
    • asSetContent

      String asSetContent()
      Return just the content of the set without the square brackets.
    • not

      RE.C not()
      Some character sets have a reverse name. For example the `\s` has `\S`. A set with square brackets can be reversed by adding/removing a `^` as first character. This overrides the RE version but returns a C so this can be repeated.
      Specified by:
      not in interface RE