this post was submitted on 13 Jul 2023
2 points (100.0% liked)

Lemmy App Development

711 readers
1 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
2
Regex for lemmy spoilers (programming.dev)
submitted 1 year ago* (last edited 1 year ago) by starman@programming.dev to c/lemmydev@lemm.ee
 

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 1 comments
sorted by: hot top controversial new old
[โ€“] Prefix@lemm.ee 1 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 ๐Ÿ˜ญ