1
0
mirror of https://github.com/tateisu/SubwayTooter synced 2025-02-06 13:43:33 +01:00

fix username regex

This commit is contained in:
tateisu 2018-11-30 13:55:05 +09:00
parent fbe7485e06
commit e207421fcd
2 changed files with 2 additions and 2 deletions

View File

@ -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)

View File

@ -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
)