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

Lemmy App Development

693 readers
2 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
1
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

you are viewing a single comment's thread
view the rest of the comments
[โ€“] 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 ๐Ÿ˜ญ