RegexDsl 0.1.0 indexed Enhances regular expression creation with a type-safe, expressive DSL, supporting automatic character escaping, named groups, lookahead/lookbehind assertions, and common regex operations.
Bring this to kpkg
This library is indexed from the KMP ecosystem and already resolves through kpkg.dev's Maven Central proxy. Maintainers can verify the namespace and publish future versions to kpkg for free hosting, real download stats, and signed-provenance pages.
Publishing coming soonMetadata
Owner Stream29
Stars 1
Used by —
Health —
License —
Latest 0.1.0
Repository github.com/Stream29/RegexDsl
Updated 2025-06-14 Readme Changelog RegexDsl
A Kotlin Multiplatform library that provides a DSL for writing regular expressions in a more readable and maintainable way.
Features
Type-safe and expressive API for building regex patterns
Automatic escaping of special characters
Support for all common regex operations:
String matching
Character sets and ranges
Groups (captured, uncaptured, named)
Quantifiers (exactly, at least, at most, etc.)
Lookahead and lookbehind assertions
Boundaries (string begin/end, word boundaries)
Meta characters (digit, word, space, etc.)
Multiplatform support (JVM, JS, Native, Wasm)
Installation
Gradle
implementation("io.github.stream29:regexdsl:0.0.1" )
Usage
Basic Example
See at examples.ipynb
API Reference
Main Functions
buildRegex { ... }: Creates a Regex object using the DSL
buildRegexString { ... }: Returns the string representation of the regex pattern
Matching Functions
match(string): Matches a literal string (automatically escaped)
Boundary Functions
matchStringBegin(): Matches the beginning of the string (^)
matchStringEnd(): Matches the end of the string ($)
Group Functions
matchIndexedGroup { ... }: Creates a capturing group ((...))
matchNamedGroup(name) { ... }: Creates a named capturing group ((?<name>...))
matchUncapturedGroup { ... }: Creates a non-capturing group ((?:...))
Lookaround Functions
lookahead { ... }: Creates a positive lookahead assertion ((?=...))
lookaheadNegative { ... }: Creates a negative lookahead assertion ( )
Other Functions
insertOr(): Inserts an alternation operator (|)
Meta Characters
Quantifiers
Supported Platforms
JVM
JavaScript
Native (iOS, macOS, Linux, Windows, watchOS, tvOS, Android)
WebAssembly (Wasm)
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
match(char): Matches a literal character (automatically escaped)
match(regexElement): Matches a regex element (e.g., digitChar, wordChar)
matchCharacterSet { ... }: Matches a character set (e.g., [abc])
matchNegatedCharacterSet { ... }: Matches a negated character set (e.g., [^abc])
matchWordBoundary(): Matches a word boundary (\b)
matchNonWordBoundary(): Matches a non-word boundary (\B)(?!...)
lookbehind { ... }: Creates a positive lookbehind assertion ((?<=...))
lookbehindNegative { ... }: Creates a negative lookbehind assertion ((?<!...))
anyChar: Matches any character (.)
digitChar: Matches a digit character (\d)
nonDigitChar: Matches a non-digit character (\D)
wordChar: Matches a word character (\w)
nonWordChar: Matches a non-word character (\W)
spaceChar: Matches a whitespace character (\s)
nonSpaceChar: Matches a non-whitespace character (\S)
Quantifier.anyTimes: Matches 0 or more times (*)
Quantifier.atLeastOne: Matches 1 or more times (+)
Quantifier.atMostOne: Matches 0 or 1 time (?)
Quantifier.exactly(n): Matches exactly n times ({n})
Quantifier.atLeast(n): Matches at least n times ({n,})
Quantifier.inRange(n..m): Matches between n and m times ({n,m})
Lazy versions: atLeastOneLazy, atLeastLazy(n), inRangeLazy(n..m) Related libraries Surfaced from shared tags and platforms — no rankings paid for.
kotlinx-benchmark ★ 635
Kotlin Toolkit for running benchmarks on multiplatform code, offering low noise, reliable results, statistical analysis, and detailed performance reports. Supports various target configurations and custom benchmark profiles. Shared: wasm, kotlin-native, kotlin-dsl Canard ★ 42
kosi-libs Lightweight logging library with a simple API, supporting multiple platforms. Facilitates easy logging setup, multi-level logging, and seamless integration with platform-specific frontends. Shared: wasm, utility, kotlin-native kotlinx.collections.immutable ★ 1.4k
Kotlin Implements immutable and persistent collection interfaces with efficient, order-preserving options. Offers conversion functions, `+` and `-` operators, and a `mutate` extension for simplified modifications. Shared: wasm, kotlin-native spatial-k ★ 137
maplibre Set of libraries for working with geospatial data, including GeoJson implementation and a port of Turfjs, featuring a Kotlin DSL for building GeoJson objects. Shared: utility, dsl kfswatch ★ 135
irgaly Monitors file system changes across multiple directories, emitting events such as create, delete, and modify. Allows observing file events using flows, supports multiple platforms, and provides raw event access for debugging. Shared: wasm, kotlin-native GRPC-Kotlin-Multiplatform ★ 133
TimOrtel Implements client-side gRPC with support for parsing proto3 files, generating corresponding code, and suspending RPC calls. Features a DSL for creating proto objects and supports various proto types. Shared: wasm, kotlin-native