Add Pristine Profit Tracker
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user