Remove episode number from episode title like saikou (#119)
* Add files via upload * Add files via upload * Add files via upload * use existing robust episode regex * use existing robust episode regex * use existing robust episode regex * use existing robust episode regex * allow external use of manga chapter regex as well --------- Co-authored-by: rebel onion <87634197+rebelonion@users.noreply.github.com>
This commit is contained in:
parent
038b8f7ff7
commit
97cd3dd43b
5 changed files with 84 additions and 75 deletions
|
@ -5,8 +5,8 @@ import java.util.regex.Pattern
|
|||
|
||||
class MangaNameAdapter {
|
||||
companion object {
|
||||
val chapterRegex = "(chapter|chap|ch|c)[\\s:.\\-]*([\\d]+\\.?[\\d]*)[\\s:.\\-]*"
|
||||
fun findChapterNumber(text: String): Float? {
|
||||
val regex = "(chapter|chap|ch|c)[\\s:.\\-]*([\\d]+\\.?[\\d]*)"
|
||||
val pattern: Pattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE)
|
||||
val matcher: Matcher = pattern.matcher(text)
|
||||
|
||||
|
@ -17,4 +17,4 @@ class MangaNameAdapter {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue