Skip to content

Releases: markwhitaker/RegexToolbox.kt

Breaking changes: deprecated features have been removed

18 Feb 10:24
56fae94
Compare
Choose a tag to compare

Summary

Version 3.0 marks a switchover to the new type-safe builder syntax introduced in 2.0: the old Java-style syntax that was deprecated in 2.4.0 has now been removed.

In addition, the logging API is removed in this release.

Changes in detail:

  • RegexBuilder() public constructor removed: replace with regex { ... }
  • buildRegex() removed: replace with regex { ... }
  • buildPattern() removed: replace with pattern { ... }
  • startGroup() ... endGroup() removed: replace with group { ... }
  • startNamedGroup() ... endGroup() removed: replace with namedGroup { ... }
  • startNonCapturingGroup() ... endGroup() removed: replace with nonCapturingGroup { ... }
  • addLogger() removed: no replacement

Deprecated outgoing features ready for 3.0

18 Feb 09:52
9be083b
Compare
Choose a tag to compare

The following features are deprecated in this release and will be removed in 3.0:

  • The old Java-style syntax (RegexBuilder()...buildRegex()) is deprecated. You should replace this with the new type-safe builder syntax (regex { ... }).
  • Likewise the old grouping syntax (startGroup()...endGroup()) is deprecated. You should replace this with the new type-safe builder syntax (group { ... }).
  • Logging is deprecated as it didn't add as much value as intended and causes an additional maintenance overhead.

Deprecated outgoing features ready for 3.0

18 Feb 09:48
9be083b
Compare
Choose a tag to compare

The following features are deprecated in this release and will be removed in 3.0:

  • The old Java-style syntax (RegexBuilder()...buildRegex()) is deprecated. You should replace this with the new type-safe builder syntax (regex { ... }).
  • Likewise the old grouping syntax (startGroup()...endGroup()) is deprecated. You should replace this with the new type-safe builder syntax (group { ... }).
  • Logging is deprecated as it didn't add as much value as intended and causes an additional maintenance overhead.

New extension methods

13 Apr 09:12
90123c5
Compare
Choose a tag to compare

Added the following extension methods:

  • Regex.remove(input: CharSequence)
  • Regex.removeFirst(input: CharSequence)
  • Regex.removeLast(input: CharSequence)
  • CharSequence.remove(regex: Regex)
  • CharSequence.removeFirst(regex: Regex)
  • CharSequence.removeLast(regex: Regex)

Also removed deprecated properties from RegexQuantifier.

New extension methods

30 Mar 16:34
90123c5
Compare
Choose a tag to compare
New extension methods Pre-release
Pre-release

Added the following extension methods:

  • Regex.remove(input: CharSequence)
  • Regex.removeFirst(input: CharSequence)
  • Regex.removeLast(input: CharSequence)
  • CharSequence.remove(regex: Regex)
  • CharSequence.removeFirst(regex: Regex)
  • CharSequence.removeLast(regex: Regex)

Also removed deprecated properties from RegexQuantifier.

Added logging support

10 Nov 22:54
02c9c2d
Compare
Choose a tag to compare

Attach a logger using the new RegexBuilder.addLogger() API to peep under the hood and see how your regex is being built, step by step.

Fix for anyCharacterFrom() and anyCharacterExcept()

30 Sep 11:34
326479d
Compare
Choose a tag to compare

Fixed bug in anyCharacterFrom() and anyCharacterExcept() so they work as documented

Support for Unicode letters

17 Sep 16:06
faadc02
Compare
Choose a tag to compare

The following RegexBuilder methods now support Unicode letters:

  • letter()
  • nonLetter()
  • uppercaseLetter()
  • lowercaseLetter()
  • letterOrDigit()
  • nonLetterOrDigit()
  • wordCharacter()
  • nonWordCharacter()

New Kotlin DSL-style syntax and improved quantifiers

11 Sep 21:43
96a30fc
Compare
Choose a tag to compare

This release adds a type-safe builder DSL-style syntax so you can now replace this:

val regex = RegexBuilder()
    .startGroup()
    .letter()
    .digit()
    .buildRegex() // ERROR! forgot to close group

with this:

val regex = regex {
    group {
        letter()
        digit()
    } // Yay! Can't forget to close a group
} // Yay! No need to call buildRegex()

It also makes Quantifiers a bit cleaner. Instead of this:

    text(zeroOrMore())

You now do this:

    text(ZeroOrMore) // Initial capital (bacause it's now a class), no brackets

Restored deprecated members of RegexQuantifier (with @Deprecated annotations)

03 Sep 20:20
96a30fc
Compare
Choose a tag to compare
2.0.0-alpha-2

Updated README.md