mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-28 18:10:37 +00:00
d1209e6704
Co-authored-by: Jim Dovey <jimdovey@apple.com>
20 lines
428 B
Swift
20 lines
428 B
Swift
import Foundation
|
|
import RegexBuilder
|
|
|
|
public struct LinkHandler {
|
|
public let rawLink: String
|
|
|
|
public var maxId: String? {
|
|
do {
|
|
let regex = try Regex("max_id=[0-9]+")
|
|
if let match = rawLink.firstMatch(of: regex) {
|
|
return match.output.first?.substring?.replacingOccurrences(of: "max_id=", with: "")
|
|
}
|
|
} catch {
|
|
return nil
|
|
}
|
|
return nil
|
|
}
|
|
}
|
|
|
|
extension LinkHandler: Sendable {}
|