mirror of
https://github.com/pppscn/SmsForwarder
synced 2025-08-03 01:17:41 +08:00
优化:改进IPv6正则表达式(避免{{IPV6}}
替换为空)
This commit is contained in:
parent
65581cf4dc
commit
29ca4d3300
@ -30,7 +30,7 @@ class NetworkWorker(context: Context, params: WorkerParameters) : CoroutineWorke
|
|||||||
|
|
||||||
private val TAG: String = NetworkWorker::class.java.simpleName
|
private val TAG: String = NetworkWorker::class.java.simpleName
|
||||||
private val ipv4Pattern = Regex("^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$")
|
private val ipv4Pattern = Regex("^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$")
|
||||||
private val ipv6Pattern = Regex("^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$")
|
private val ipv6Pattern = Regex("^((?:[\\da-fA-F]{0,4}:[\\da-fA-F]{0,4}){2,7})(?:[/\\\\%](\\d{1,3}))?$")
|
||||||
|
|
||||||
override suspend fun doWork(): Result {
|
override suspend fun doWork(): Result {
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user