All notable changes to string_editor will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
before_last()- Extract text before the last occurrence of a patternafter_last()- Extract text after the last occurrence of a pattern (e.g. filename from a path, extension from a multi-dot filename)replace_before()- Replace text before the first occurrence of a patternreplace_after()- Replace text after the first occurrence of a patternreplace_between()- Replace text between two patterns, keeping the delimiters
- CI tested with Gleam 1.11.1, which is below the package's declared minimum of 1.17.0 and failed to compile the package. CI now tests against both the minimum supported Gleam version (1.17.0) and the latest 1.x release, and also runs the test suite on the JavaScript target.
- README "filename from path" example used
after(), which returns the text after the first/rather than the filename. The example now uses the newafter_last().
- Condensed the README performance section into a short complexity table.
before,after, andbetweennow consistently returnError(Nil)for an empty pattern on all targets. Previously the result was target-dependent:Error(Nil)on Erlang butOkon JavaScript.
- Updated minimum Gleam version requirement from 1.4.0 to 1.17.0
- Updated gleam_stdlib requirement to
>= 1.0.0 and < 2.0.0 - Replaced removed
list.rangewithint.rangefor gleam_stdlib 1.0 compatibility (no behaviour change)
- Fixed invalid TOML syntax in the
linkssection ofgleam.toml
- Updated minimum Gleam version requirement from 1.0.0 to 1.4.0
- Removed upper bound constraint on Gleam version to improve forward compatibility
- Fixed CHANGELOG.md to accurately reflect Gleam string_editor functions
- Code formatting improvements
- Initial release of string_editor for Gleam
- Core string extraction functions:
before()- Extract text before first occurrence of patternafter()- Extract text after first occurrence of patternbetween()- Extract text between two patternscount()- Count occurrences of pattern in string
- Indexed extraction functions:
before_at()- Extract text before nth occurrence of patternafter_at()- Extract text after nth occurrence of patternbetween_at()- Extract text between nth occurrence of start and next end pattern
- Batch extraction functions:
before_all()- Extract all text segments before each pattern occurrenceafter_all()- Extract all text segments after each pattern occurrencebetween_all()- Extract all text segments between pattern pairs
- Comprehensive test suite
- Full documentation with usage examples
- Published to Hex package manager