Rebake Match pattern for images

Continuing the discussion from Rebake all posts matching a pattern:

Can I have a rebake_match[""] pattern for posts that contain an image? I am adding an s3_cdn_url to my S3 bucket settings and it requires me to rebake all old posts.

Reference:
https://meta.discourse.org/t/s3-upload-with-vanity-domains

I think I found the solution courtesy to this thread on Stack Overflow.

rebake_match["!\[[^\]]+\]\([^)]+\)",regex]

I hope it helps someone out.

3 Likes

That looks like it should work for that particular syntax. But be aware that there is other syntax that regex pattern will not match.

https://spec.commonmark.org/0.28/#images

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.