Skip to content

Commit

Permalink
Optimize regex with Chatgpt
Browse files Browse the repository at this point in the history
  • Loading branch information
Dude so hot authored and revonateB0T committed Oct 25, 2024
1 parent 06eb277 commit 4c20d27
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ object GalleryDetailParser {
private val PATTERN_PREVIEW_PAGES =
Regex("<td[^>]+><a[^>]+>([\\d,]+)</a></td><td[^>]+>(?:<a[^>]+>)?&gt;(?:</a>)?</td>")
private val PATTERN_NORMAL_PREVIEW =
Regex("<div class=\"gdtm\"[^<>]*><div[^<>]*width:(\\d+)[^<>]*height:(\\d+)[^<>]*\\((.+?)\\)[^<>]*-(\\d+)px[^<>]*><a[^<>]*href=\"(.+?)\"[^<>]*><img alt=\"([\\d,]+)\"")
Regex("<div class=\"gdtm\"[^>]*><div[^>]*width:(\\d+)[^>]*height:(\\d+)[^>]*\\(([^)]+)\\)[^>]*-(\\d+)px[^>]*><a[^>]*href=\"([^\"]+)\"[^>]*><img alt=\"([\\d,]+)\"")
private val PATTERN_NORMAL_PREVIEW_NEW =
Regex("<a href=\"(.+?)\"><div[^<>]*title=\"Page (\\d+):[^<>]*width:(\\d+)[^<>]*height:(\\d+)[^<>]*\\((.+?)\\)[^<>]*-(\\d+)px[^<>]*>")
Regex("<a href=\"([^\"]+)\"><div[^>]*title=\"Page (\\d+):[^>]*width:(\\d+)[^>]*height:(\\d+)[^>]*\\(([^)]+)\\)[^>]*-(\\d+)px[^>]*>")
private val PATTERN_LARGE_PREVIEW =
Regex("<div class=\"gdtl\".+?<a href=\"(.+?)\"><img alt=\"([\\d,]+)\".+?src=\"(.+?)\"")
Regex("<div class=\"gdtl\"[^>]*><a href=\"([^\"]+)\"><img alt=\"([\\d,]+)\"[^>]*src=\"([^\"]+)\"")
private val PATTERN_LARGE_PREVIEW_NEW =
Regex("<a href=\"(.+?)\"><div[^<>]*title=\"Page (\\d+):[^<>]*\\((.+?)\\)[^<>]*0 0[^<>]*>")
Regex("<a href=\"([^\"]+)\"><div[^>]*title=\"Page (\\d+):[^>]*\\(([^)]+)\\)[^>]*0 0[^>]*>")
private val PATTERN_NEWER_DATE = Regex(", added (.+?)<br />")
private val PATTERN_FAVORITE_SLOT =
Regex("/fav.png\\); background-position:0px -(\\d+)px")
Expand Down

0 comments on commit 4c20d27

Please sign in to comment.