mirror of
https://github.com/tateisu/SubwayTooter
synced 2025-02-06 13:43:33 +01:00
fix username regex
This commit is contained in:
parent
fbe7485e06
commit
e207421fcd
@ -27,7 +27,7 @@ open class TootAccount(parser : TootParser, src : JSONObject) {
|
||||
|
||||
// host, user ,(instance)
|
||||
internal val reAccountUrl : Pattern =
|
||||
Pattern.compile("""\Ahttps://([A-Za-z0-9._-]+)/@([A-Za-z0-9_][A-Za-z0-9_-]+)(?:@([A-Za-z0-9._-]+))?(?:\z|[?#])""")
|
||||
Pattern.compile("""\Ahttps://([A-Za-z0-9][A-Za-z0-9._-]+)/@([\w][\w.-]+)(?:@([A-Za-z0-9][A-Za-z0-9._-]+))?(?=\z|[?#])""")
|
||||
|
||||
fun getAcctFromUrl(url : String) : String? {
|
||||
val m = reAccountUrl.matcher(url)
|
||||
|
@ -1369,7 +1369,7 @@ object MisskeyMarkdownDecoder {
|
||||
|
||||
// メンション @username @username@host
|
||||
val reMention = Pattern.compile(
|
||||
"""\A@([a-z0-9_]+)(?:@([a-z0-9.\-]+[a-z0-9]))?"""
|
||||
"""\A@([a-z0-9_]+(?:[a-z0-9_.-]+[a-z0-9_]+)?)(?:@([A-Za-z0-9][A-Za-z0-9._-]+))?"""
|
||||
, Pattern.CASE_INSENSITIVE
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user