this post was submitted on 13 Jul 2023
9 points (90.9% liked)

Lemmy App Development

693 readers
18 users here now

A place for Lemmy builders to chat about building apps, clients, tools and bots for the Lemmy platform.

On-Topic:

Off-Topic:

founded 1 year ago
MODERATORS
9
Regex for lemmy spoilers (programming.dev)
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 

Through trial and errors, I've created regex for lemmy spoilers:

/:::\sspoiler\s+(?<title>.+)\n(?<body>[\s\S]+?)\n:::/g

link to regex101.com with explanation

top 2 comments
sorted by: hot top controversial new old
[โ€“] [email protected] 3 points 1 year ago

Nice! Thanks for this! I was taking a peek at how some other apps are handling this (i.e Memmy) and this looks more complete, although TBH I still find regex archaic and a pain to debug ๐Ÿ˜ญ

[โ€“] [email protected] 1 points 1 year ago

Thank you for sharing!