java.lang.Object
io.cucumber.cucumberexpressions.RegexpUtils

final class RegexpUtils extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final boolean[]
    List of characters to be escaped.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) static String
    Escapes the regexp characters (the ones from "^$(){}[].+*?\") from the given text, so that they are not considered as regexp characters.

    Methods inherited from class java.lang.Object

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

    • CHAR_TO_ESCAPE

      private static final boolean[] CHAR_TO_ESCAPE
      List of characters to be escaped. The last char is '}' with index 125, so we need only 126 characters.
  • Constructor Details

    • RegexpUtils

      private RegexpUtils()
  • Method Details

    • escapeRegex

      static String escapeRegex(String text)
      Escapes the regexp characters (the ones from "^$(){}[].+*?\") from the given text, so that they are not considered as regexp characters.
      Parameters:
      text - the non-null input text
      Returns:
      the input text with escaped regexp characters