Add Pristine Profit Tracker

This commit is contained in:
Linnea Gräf
2024-01-15 00:32:43 +01:00
parent c49b65835d
commit ac151c8ebc
16 changed files with 557 additions and 15 deletions

View File

@@ -6,5 +6,13 @@
package moe.nea.firmament.util
import java.util.regex.Matcher
import java.util.regex.Pattern
inline fun <T> String.ifMatches(regex: Regex, block: (MatchResult) -> T): T? =
regex.matchEntire(this)?.let(block)
inline fun <T> Pattern.useMatch(string: String, block: Matcher.() -> T): T? =
matcher(string)
.takeIf(Matcher::matches)
?.let(block)