Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ fun String.validateUri(existingUris: List<String>): Text? {
* Checks if the string matches a specific URI pattern.
*/
fun String.isValidPattern(): Boolean {
val pattern = "^(https?|androidapp)://([A-Za-z0-9-]+(?:\\.[A-Za-z0-9-]+)*)(/.*)?$".toRegex()
val pattern = "^(https?|androidapp)://([A-Za-z0-9_-]+(?:\\.[A-Za-z0-9_-]+)*)(/.*)?$".toRegex()
return matches(pattern)
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ class StringExtensionsTest {
"https://a",
"http://a.com",
"https://subdomain.example.com",
"https://example.com/path_with_underscores",
"androidapp://com.example.app",
"androidapp://com.example.app/path_with_underscores",
)

val invalidUris = listOf(
Expand Down
Loading