Class CharClasses

java.lang.Object
dev.yasint.regexsynth.ast.CharClasses

public final class CharClasses
extends java.lang.Object
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  CharClasses.EscapeSequences  
    static class  CharClasses.Posix
    Posix character classes.
  • Constructor Summary

    Constructors 
    Constructor Description
    CharClasses()  
  • Method Summary

    Modifier and Type Method Description
    static Expression anything()
    Matches any character, possibly including newline \n if the 's' RegexSynth.Flags DOTALL flag is turned on.
    static RegexSet negated​(RegexSet set)
    Simply converts a given set to a negated character class.
    static RegexSet rangedSet​(int codepointA, int codepointB)
    Creates a ranged regex charclass.
    static RegexSet rangedSet​(java.lang.String from, java.lang.String to)
    Creates a ranged regex charclass.
    static RegexSet simpleSet​(int... codepoints)  
    static RegexSet simpleSet​(java.lang.String... characters)
    Creates a simple regex charclass i.e.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • anything

      public static Expression anything()
      Matches any character, possibly including newline \n if the 's' RegexSynth.Flags DOTALL flag is turned on.
      Returns:
      match anything expression
    • negated

      public static RegexSet negated​(RegexSet set)
      Simply converts a given set to a negated character class. [^acd]
      Parameters:
      set - source set to convert
      Returns:
      negated set expression
    • rangedSet

      public static RegexSet rangedSet​(java.lang.String from, java.lang.String to)
      Creates a ranged regex charclass. i.e. [A-Z]
      Parameters:
      from - staring char inclusive (surrogates or bmp)
      to - ending char inclusive (surrogates or bmp)
      Returns:
      set expression
    • rangedSet

      public static RegexSet rangedSet​(int codepointA, int codepointB)
      Creates a ranged regex charclass. i.e. [A-Z]
      Parameters:
      codepointA - staring codepoint inclusive
      codepointB - ending codepoint inclusive
      Returns:
      set expression
    • simpleSet

      public static RegexSet simpleSet​(java.lang.String... characters)
      Creates a simple regex charclass i.e. [135]
      Parameters:
      characters - characters (surrogates or bmp)
      Returns:
      set expression
    • simpleSet

      public static RegexSet simpleSet​(int... codepoints)
      Parameters:
      codepoints - codepoints
      Returns:
      set expression