package regex
- Source
- package.scala
- Alphabetic
- By Inheritance
- regex
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- sealed case class CompileError(message: String) extends RegexError with Product with Serializable
Describes errors that occur while compiling a regular expression.
- type CompileResult[A] = Either[CompileError, A]
Result type for compilation operations.
- 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]
- sealed abstract class DecodeError extends RegexError
- type DecodeResult[A] = Either[DecodeError, A]
Result type for decoding operations.
- trait GeneratedMatchDecoders extends AnyRef
- 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.
- trait GroupDecoderInstances extends AnyRef
Declares all default GroupDecoder instances.
- 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.
- 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.
- trait MatchDecoderInstances extends AnyRef
Declares default MatchDecoder instances.
- type Pattern = java.util.regex.Pattern
- trait PlatformSpecificInstances extends AnyRef
- trait Regex[A] extends AnyRef
Compiled version of a regular expression.
- sealed abstract class RegexError extends Error
Root class for all regular expression related errors.
- type RegexResult[A] = Either[RegexError, A]
Result type for all regex related operations (encompasses both DecodeResult and CompileResult.
- trait TupleDecoders extends AnyRef
Value Members
- object CompileError extends ErrorCompanion[CompileError]
- object CompileResult extends WithError[CompileError]
Provides creation methods for CompileResult.
- object Compiler
Provides default instances, instance creation and instance summoning methods.
- object DecodeError extends Serializable
- object DecodeResult extends WithDefault[DecodeError]
Provides construction methods for DecodeResult.
- object GroupDecoder extends DecoderCompanion[Option[String], DecodeError, codecs.type] with PlatformSpecificInstances
Provides instance creation and summoning methods for GroupDecoder.
- 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
ordecoder
methods make it simple to create MatchDecoder instances for more complicated types. - object Regex
- object RegexResult extends Simple[RegexError]
- object codecs extends GroupDecoderInstances with MatchDecoderInstances with TupleDecoders
Acts as a type tag for regex-specific
kantan.codecs.Decoder
instances. - object implicits extends ToRegexLiteral with AllOps
Provides a convenient way to bring syntax and literals in scope with a single import.