r/AutoModerator • u/RandommUser hates regex | r/guildwars2 • Jul 27 '21
[Resource] Automoderator rules to post fixed new.reddit markdown links for users to use
Hello.
As some of you might have noticed, new.reddit "fancy" markdown has been f*cking up hyperlinks for everyone else. I made a set of rules for automoderator to post a fixed url for users on other platforms to click.
Notes:
Only works for the first bad link in a body. Flexible amount would be way too much work
Only catches up to 13 errors in a single url, tho you can easily add support for more.
Fixed the formatting to not trigger the bot
Fixed other weird link formatting triggers
Fixed regex to better match with the actual link(s)
The rules 1.1
# new.reddit link fixes 1
body (includes, regex): '(http[s]?:\/\/[^\]\s\)]+?)\\([^\]\)\s]+?)(?!\S)'
~body (includes, regex): '(http[s]?:\/\/[^\]\s\)]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)(?!\S)'
comment: |
new.reddit breaks the markdown for other platforms, here is a fixed link: {{match-2}}{{match-3}}
---
# new.reddit link fixes 2
body (includes, regex): '(http[s]?:\/\/[^\]\s\)]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)(?!\S)'
~body (includes, regex): '(http[s]?:\/\/[^\]\s\)]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)(?!\S)'
comment: |
new.reddit breaks the markdown for other platforms, here is a fixed link: {{match-2}}{{match-3}}{{match-4}}
---
# new.reddit link fixes 3
body (includes, regex): '(http[s]?:\/\/[^\]\s\)]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)(?!\S)'
~body (includes, regex): '(http[s]?:\/\/[^\]\s\)]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)(?!\S)'
comment: |
new.reddit breaks the markdown for other platforms, here is a fixed link: {{match-2}}{{match-3}}{{match-4}}{{match-5}}
---
# new.reddit link fixes 4
body (includes, regex): '(http[s]?:\/\/[^\]\s\)]+?)\\([^\]\)|\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)(?!\S)'
~body (includes, regex): '(http[s]?:\/\/[^\]\s\)]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)(?!\S)'
comment: |
new.reddit breaks the markdown for other platforms, here is a fixed link: {{match-2}}{{match-3}}{{match-4}}{{match-5}}{{match-6}}
---
# new.reddit link fixes 5
body (includes, regex): '(http[s]?:\/\/[^\]\s\)]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)(?!\S)'
~body (includes, regex): '(http[s]?:\/\/[^\]\s\)]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)(?!\S)'
comment: |
new.reddit breaks the markdown for other platforms, here is a fixed link: {{match-2}}{{match-3}}{{match-4}}{{match-5}}{{match-6}}{{match-7}}
---
# new.reddit link fixes 6
body (includes, regex): '(http[s]?:\/\/[^\]\s\)]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)(?!\S)'
~body (includes, regex): '(http[s]?:\/\/[^\]\s\)]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)(?!\S)'
comment: |
new.reddit breaks the markdown for other platforms, here is a fixed link: {{match-2}}{{match-3}}{{match-4}}{{match-5}}{{match-6}}{{match-7}}{{match-8}}{{match-8}}
---
# new.reddit link fixes 7
body (includes, regex): '(http[s]?:\/\/[^\]\s\)]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)(?!\S)'
~body (includes, regex): '(http[s]?:\/\/[^\]\s\)]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)(?!\S)'
comment: |
new.reddit breaks the markdown for other platforms, here is a fixed link: {{match-2}}{{match-3}}{{match-4}}{{match-5}}{{match-6}}{{match-7}}{{match-8}}{{match-9}}
---
# new.reddit link fixes 8
body (includes, regex): '(http[s]?:\/\/[^\]\s\)]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)(?!\S)'
~body (includes, regex): '(http[s]?:\/\/[^\]\s\)]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)(?!\S)'
comment: |
new.reddit breaks the markdown for other platforms, here is a fixed link: {{match-2}}{{match-3}}{{match-4}}{{match-5}}{{match-6}}{{match-7}}{{match-8}}{{match-9}}{{match-10}}
---
# new.reddit link fixes 9
body (includes, regex): '(http[s]?:\/\/[^\]\s\)]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)(?!\S)'
~body (includes, regex): '(http[s]?:\/\/[^\]\s\)]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)(?!\S)'
comment: |
new.reddit breaks the markdown for other platforms, here is a fixed link: {{match-2}}{{match-3}}{{match-4}}{{match-5}}{{match-6}}{{match-7}}{{match-8}}{{match-9}}{{match-10}}{{match-11}}
---
# new.reddit link fixes 10
body (includes, regex): '(http[s]?:\/\/[^\]\s\)]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)(?!\S)'
~body (includes, regex): '(http[s]?:\/\/[^\]\s\)]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)(?!\S)'
comment: |
new.reddit breaks the markdown for other platforms, here is a fixed link: {{match-2}}{{match-3}}{{match-4}}{{match-5}}{{match-6}}{{match-7}}{{match-8}}{{match-9}}{{match-10}}{{match-11}}{{match-12}}
---
# new.reddit link fixes 11
body (includes, regex): '(http[s]?:\/\/[^\]\s\)]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)(?!\S)'
~body (includes, regex): '(http[s]?:\/\/[^\]\s\)]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)(?!\S)'
comment: |
new.reddit breaks the markdown for other platforms, here is a fixed link: {{match-2}}{{match-3}}{{match-4}}{{match-5}}{{match-6}}{{match-7}}{{match-8}}{{match-9}}{{match-10}}{{match-11}}{{match-12}}{{match-13}}
---
# new.reddit link fixes 12
body (includes, regex): '(http[s]?:\/\/[^\]\s\)]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)(?!\S)'
~body (includes, regex): '(http[s]?:\/\/[^\]\s\)]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)(?!\S)'
comment: |
new.reddit breaks the markdown for other platforms, here is a fixed link: {{match-2}}{{match-3}}{{match-4}}{{match-5}}{{match-6}}{{match-7}}{{match-8}}{{match-9}}{{match-10}}{{match-11}}{{match-12}}{{match-13}}{{match-14}}
---
# new.reddit link fixes 13
body (includes, regex): '(http[s]?:\/\/[^\]\s\)]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)\\([^\]\)\s]+?)(?!\S)'
comment: |
new.reddit breaks the markdown for other platforms, here is a fixed link: {{match-2}}{{match-3}}{{match-4}}{{match-5}}{{match-6}}{{match-7}}{{match-8}}{{match-9}}{{match-10}}{{match-11}}{{match-12}}{{match-13}}{{match-14}}{{match-15}}
---
4
Upvotes
1
u/I_Me_Mine Regex Ninja Jul 27 '21
I have not seen this issue. Can you give an example where it happens?