mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-24 00:44:43 +01:00
Fixed regex.
This commit is contained in:
parent
3d50afd139
commit
fe82b5686e
@ -31,9 +31,9 @@ public class LinkResolverActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
private static final String POST_PATTERN = "/r/\\w+/comments/\\w+/{0,1}\\w+/{0,1}";
|
private static final String POST_PATTERN = "/r/\\w+/comments/\\w+/{0,1}\\w+/{0,1}";
|
||||||
private static final String COMMENT_PATTERN = "/r/\\w+/comments/\\w+/{0,1}\\w+/\\w+/{0,1}";
|
private static final String COMMENT_PATTERN = "/r/\\w+/comments/\\w+/{0,1}\\w+/\\w+/{0,1}";
|
||||||
private static final String SUBREDDIT_PATTERN = "/r/\\w+/*";
|
private static final String SUBREDDIT_PATTERN = "/r/\\w+/{0,1}";
|
||||||
private static final String USER_PATTERN_1 = "/user/\\w+/*";
|
private static final String USER_PATTERN_1 = "/user/\\w+/{0,1}";
|
||||||
private static final String USER_PATTERN_2 = "/u/\\w+/*";
|
private static final String USER_PATTERN_2 = "/u/\\w+/{0,1}";
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
SharedPreferences mSharedPreferences;
|
SharedPreferences mSharedPreferences;
|
||||||
|
@ -2,7 +2,7 @@ package ml.docilealligator.infinityforreddit;
|
|||||||
|
|
||||||
class Utils {
|
class Utils {
|
||||||
static String addSubredditAndUserLink(String markdown) {
|
static String addSubredditAndUserLink(String markdown) {
|
||||||
return markdown.replaceAll("(?<!\\w)/*u/\\w+/*", "[$0]($0)")
|
return markdown.replaceAll("(?<!\\w)/{0,1}u/\\w+/{0,1}", "[$0]($0)")
|
||||||
.replaceAll("(?<!\\w)/*r/\\w+/*", "[$0]($0)");
|
.replaceAll("(?<!\\w)/{0,1}r/\\w+/{0,1}", "[$0]($0)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user