p

kantan

regex

package regex

Source
package.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. regex
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Package Members

  1. package generic
  2. package laws
  3. package literals
  4. package ops

Type Members

  1. sealed case class CompileError(message: String) extends RegexError with Product with Serializable

    Describes errors that occur while compiling a regular expression.

  2. type CompileResult[A] = Either[CompileError, A]

    Result type for compilation operations.

  3. trait Compiler[E] extends AnyRef

    Type class for types that can be compiled to instances of Regex.

    Type class for types that can be compiled to instances of Regex.

    While regular expression literals are usually the preferred way of creating instances of Regex, they don't fit all possible situations - one might imagine, for example, a scenario where a regular expression is created dynamically before being compiled.

    Compiler is provided for these cases where literals are not an option. The preferred way of using it is to make sure the corresponding syntax is in scope and use the asRegex method:

    // Obtain a regular expression as a string somehow.
    val regex: String = ???
    
    // Promote it to a Regex[Int]
    regex.asRegex[Int]
  4. sealed abstract class DecodeError extends RegexError
  5. type DecodeResult[A] = Either[DecodeError, A]

    Result type for decoding operations.

  6. trait GeneratedMatchDecoders extends AnyRef
  7. type GroupDecoder[A] = Decoder[Option[String], A, DecodeError, codecs.type]

    Type class for types that can be decoded from capturing groups.

    Type class for types that can be decoded from capturing groups.

    See the companion object for instance creation methods.

  8. trait GroupDecoderInstances extends AnyRef

    Declares all default GroupDecoder instances.

  9. class Match extends AnyRef

    Represents a single match in a regular expression evaluation.

    Represents a single match in a regular expression evaluation.

    It's usually better not to interact with Match directly - more often than not, adapting existing instances of MatchDecoder is the better solution. When in a situation where you *must* deal with such values directly, it's important not to hold onto them: due to the way kantan.regex works internally, Match is mutable.

  10. type MatchDecoder[A] = Decoder[Match, A, DecodeError, codecs.type]

    Type class for type that can be decoded from regular expression matches.

    Type class for type that can be decoded from regular expression matches.

    See the companion object for instance creation methods.

  11. trait MatchDecoderInstances extends AnyRef

    Declares default MatchDecoder instances.

  12. type Pattern = java.util.regex.Pattern
  13. trait PlatformSpecificInstances extends AnyRef
  14. trait Regex[A] extends AnyRef

    Compiled version of a regular expression.

  15. sealed abstract class RegexError extends Error

    Root class for all regular expression related errors.

  16. type RegexResult[A] = Either[RegexError, A]

    Result type for all regex related operations (encompasses both DecodeResult and CompileResult.

  17. trait TupleDecoders extends AnyRef

Value Members

  1. object CompileError extends ErrorCompanion[CompileError]
  2. object CompileResult extends WithError[CompileError]

    Provides creation methods for CompileResult.

  3. object Compiler

    Provides default instances, instance creation and instance summoning methods.

  4. object DecodeError extends Serializable
  5. object DecodeResult extends WithDefault[DecodeError]

    Provides construction methods for DecodeResult.

  6. object GroupDecoder extends DecoderCompanion[Option[String], DecodeError, codecs.type] with PlatformSpecificInstances

    Provides instance creation and summoning methods for GroupDecoder.

  7. object MatchDecoder extends GeneratedMatchDecoders with DecoderCompanion[Match, DecodeError, codecs.type]

    Provides useful methods for MatchDecoder instance summoning and creation.

    Provides useful methods for MatchDecoder instance summoning and creation.

    If trying to create a MatchDecoder from a type for which you already have a GroupDecoder, use MatchDecoder$.fromGroup[A](index:Int)*.

    Otherwise, the ordered or decoder methods make it simple to create MatchDecoder instances for more complicated types.

  8. object Regex
  9. object RegexResult extends Simple[RegexError]
  10. object codecs extends GroupDecoderInstances with MatchDecoderInstances with TupleDecoders

    Acts as a type tag for regex-specific kantan.codecs.Decoder instances.

  11. object implicits extends ToRegexLiteral with AllOps

    Provides a convenient way to bring syntax and literals in scope with a single import.

Inherited from AnyRef

Inherited from Any

Ungrouped