# Rebake Match pattern for images

**URL:** https://meta.discourse.org/t/rebake-match-pattern-for-images/107634
**Category:** Support
**Created:** [January 27, 2019, 6:50am UTC](https://meta.discourse.org/t/rebake-match-pattern-for-images/107634 "2019-01-27T06:50:22Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![masterakay](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/masterakay/32/122593_2.png) [@masterakay](https://meta.discourse.org/u/masterakay)
#### Post date: [January 27, 2019, 6:50am UTC](https://meta.discourse.org/t/rebake-match-pattern-for-images/107634/1 "2019-01-27T06:50:22Z")

</div>

Continuing the discussion from [Rebake all posts matching a pattern](https://meta.discourse.org/t/rebake-all-posts-matching-a-pattern/48713):

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](https://meta.discourse.org/t/s3-upload-with-vanity-domains)

---

<div class="post-metadata">

### Author: ![masterakay](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/masterakay/32/122593_2.png) [@masterakay](https://meta.discourse.org/u/masterakay)
#### Post date: [January 27, 2019, 12:58pm UTC](https://meta.discourse.org/t/rebake-match-pattern-for-images/107634/2 "2019-01-27T12:58:27Z")

</div>

I think I found the solution courtesy to [this thread](https://stackoverflow.com/questions/36391979/find-markdown-image-syntax-in-string-in-java) on Stack Overflow.

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

```

I hope it helps someone out.

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [January 27, 2019, 9:58pm UTC](https://meta.discourse.org/t/rebake-match-pattern-for-images/107634/3 "2019-01-27T21:58:15Z")

</div>

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

> **[6.6Images - CommonMark Spec](https://spec.commonmark.org/0.28/#images)**
>
> Markdown is a plain text format for writing structured documents, based on conventions for indicating formatting in email and usenet posts. It was developed by John Gruber (with help from Aaron Swartz) and released in 2004 in the form of a syntax...

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [February 26, 2019, 9:58pm UTC](https://meta.discourse.org/t/rebake-match-pattern-for-images/107634/4 "2019-02-26T21:58:18Z")

</div>

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