File tree Expand file tree Collapse file tree
app/src/main/java/to/bitkit/ui/settings/advanced Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,6 +25,16 @@ class RgsServerViewModel @Inject constructor(
2525 private val lightningRepo : LightningRepo ,
2626) : ViewModel() {
2727
28+ companion object {
29+ private val URL_PATTERN = Regex (
30+ " ^(https?://)?" + // protocol
31+ " ((([a-z\\ d]([a-z\\ d-]*[a-z\\ d])*)\\ .)+[a-z]{2,}|" + // domain name
32+ " ((\\ d{1,3}\\ .){3}\\ d{1,3}))" + // IP (v4) address
33+ " (:\\ d+)?(/[-a-z\\ d%_.~+]*)*" , // port and path
34+ RegexOption .IGNORE_CASE
35+ )
36+ }
37+
2838 private val _uiState = MutableStateFlow (RgsServerUiState ())
2939 val uiState: StateFlow <RgsServerUiState > = _uiState .asStateFlow()
3040
@@ -118,16 +128,6 @@ class RgsServerViewModel @Inject constructor(
118128
119129 return URL_PATTERN .matches(data)
120130 }
121-
122- companion object {
123- private val URL_PATTERN = Regex (
124- " ^(https?://)?" + // protocol
125- " ((([a-z\\ d]([a-z\\ d-]*[a-z\\ d])*)\\ .)+[a-z]{2,}|" + // domain name
126- " ((\\ d{1,3}\\ .){3}\\ d{1,3}))" + // IP (v4) address
127- " (:\\ d+)?(/[-a-z\\ d%_.~+]*)*" , // port and path
128- RegexOption .IGNORE_CASE
129- )
130- }
131131}
132132
133133@Stable
You can’t perform that action at this time.
0 commit comments