Skip to content

Commit 02514fe

Browse files
committed
chore: changed canonical name validation rules
1 parent 08c923e commit 02514fe

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

mmrpc-runtime/src/commonMain/kotlin/CanonicalName.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ value class CanonicalName(val value: String) : Comparable<CanonicalName> {
4343
}
4444

4545
companion object {
46-
val SEGMENT_REGEXP = Regex("[A-Za-z][A-Za-z0-9_-]*")
47-
val REGEXP = Regex("([A-Za-z][A-Za-z0-9_-]*)(\\.[A-Za-z][A-Za-z0-9_-]*)*")
46+
val SEGMENT_REGEXP = Regex("-?[A-Za-z][A-Za-z0-9_]*")
47+
val REGEXP = Regex("(-?[A-Za-z][A-Za-z0-9_]*)(\\.-?[A-Za-z][A-Za-z0-9_]*)*")
4848
}
4949

5050
inline val name get() = value.substringAfterLast(".")

0 commit comments

Comments
 (0)